Sample (Samp)

This function is available on the Add Study window and in the Formula Toolbox.

Sample identifies a price value when a user specified condition is met. This study evaluates a condition on a True/False basis and returns the desired Input value when the condition changes from False to True or remains True, depending on parameter settings.

Sample is an effective tool for identifying support and resistance points defined by the occurrence of a specific condition.

An example is to use High as the input on a downside reversal day. The Sample parameters would be set as following:

Price = High

Capture = At Edge

Hold = On

Condition = Higher High than prior bar and a close down.

Sample may be used to assist in the development of a trade system, since it enables the user to identify specific events and analyze the market behavior following such an event.

Sample is similar to an If function.

Both functions return a Price or User value when a defined condition occurs.

Sample provides the user with greater flexibility to select or hold a specific value, based on the selected parameter settings.

Example:

Sample(@,Day(@)<> Day(@)[-1],none)

 

Parameter

Description

Display

Opens a sub-window with display properties:

      Color = Select a line color.

      Weight = Type a value for line thickness.

      Display = Select line style: line, histogram, or dash.

      ShareScale = Assign a behavior for functions and studies sharing the vertical scale:

      Auto = System determine whether sharing is feasible.

      On = Scale is shared regardless of the functions and studies displayed.

      Off = Scale is not shared.

MarkIt

Opens the Specify Conditions for Marking Bar window.

Price

Price used for calculations.

Capture

Values:

at edge = Value returned changes only when the condition goes from False to True. The resulting Sample is displayed as a horizontal line that shifts levels as the condition changes from False to True.

when true = Value returned changes on each observation for which the condition is True. If the input parameter is set to a price, the Sample follows the market up or down while the condition is True and is a horizontal line when the condition is False.

Hold

After a value has been found, that value is returned for all following bars until the condition becomes True again following a False state, at which time a new value is displayed.

Off = A value is returned when the condition is true.

Duration

Starting from the bar at which the condition is true, the number of bars in the output of the Price value.

Condition

Name for the condition which is evaluated for a "True" state to determine when to take a sample.

Condition (1)

Condition

Input

Sample

Hold

Value

FALSE

TRUE

LOW

At Edge

On

Low

TRUE

TRUE

LOW

At Edge

On

Low of initial TRUE

 

FALSE

LOW

At Edge

On

Last Low w/TRUE

FALSE

TRUE

LOW

At Edge

Off

Low

TRUE

TRUE

LOW

At Edge

Off

None

 

FALSE

LOW

At Edge

Off

None

FALSE

TRUE

LOW

When True

On

Low

TRUE

TRUE

LOW

When True

On

Low

 

FALSE

LOW

When True

On

Last Low w/TRUE

FALSE

TRUE

LOW

When True

Off

Low

TRUE

TRUE

LOW

When True

Off

None

 

FALSE

LOW

When True

Off

None