DYO: Global Action Category


Value[#] = 0   will fill a set of GVs with zero.
Value[#] = True   will fill a set of GVs with the True flag.

Swap(Value,GV(#))  will exchange the contents of Value and the GV whose index in the Number field.   Example

Shift Right[#] will copy a set rightward. The last value in the original set is lost.   Example set values:  6, 7, 8, 9  becomes   6, 6, 7, 8  when shifted right.   Example 1    Example 2

Shift Left[#] will copy a set leftward.  The first value in the original set is lost.  Similar to right shift, but moves values in the set in the other direction.  Example: 6, 7, 8, 9  becomes 7, 8, 9, 9

Rotate Right[#] is similar to Shift Right, with the exception that the last value is moved to the first position.

Rotate Left[#] is similar to Shift Left, with the exception that the first value is moved to the last position.

Line A through Line J = # will assign the Number value to the Line's array of values.  This is one way for a Line to change another Line's values.   Example

Beep( # ) will make a Windows message sound based on the Number value.  The wav file associated with each selection can be changed on the Windows Control Panel.  Select Sounds and Audio Devices, then click the Sounds tab.   Example

Number Beep Sound
1 Asterisk
2 Exclamation
3 Critical Stop
4 Question
all others Default Beep

PriceFinder - The PriceFinder selections in the Global Action category are very powerful features that will evaluate a Boolean Flag and return the price where the Flag will be True, False, or Change states.   For example, PriceFinder can determine the price that would make two moving averages cross, or cause CCI to cross zero, or make a bar reach a channel band.   Example

Section Font Size - Label Font Size - Use these statements to change the font sizes for Section text and Labels.

read more » DYO:  Font Size for Labels, Section
read more » DYO:  Section Fonts Options

IF Flag Do - Statements of this type read the Flag expression, and conditionally perform the action, including plotting of an option marker in the Show section of the Line.    The flag could be several flags in a set of Global Variables that are ANDed together.  The notation AND[#] evalulates a set of flags, with the set size being the value in the Number field, and the start of the GV set being the reference in the Read GV field.

There are statements for implementing a Trading System such as to Buy, Sell, Reverse, or place a limit order or stop.  These actions are similar to those that can be performed with the Sim-Broker form, or with a Study Alert trade system.

If Flag DO Plot #  will read the GV Flag, and when True will plot the # value using the marker selection.  When the marker is one of the 2 curve selections, the line will connect a prior point with the current point even though several bars may separate these two plot points.   Example

Return #, IF Flag DO Plot # - Use these statement to conditionally plot a curve.  The reason for Return # is so when a line segment is to be plotted, the prior value was stored in the Line array so the line segment knows where to plot from.   Example

Plot Study Transfer in GV - Use this statement when a value to be plotted was calculated on another chart and transfered in a Global Variable.   This statement receives special treatment to preserve its values when the chart  recalculates studies after a visit to a property form or when the chart is resized.  The values previously passed need to be preserved because they will not be passed again by the other chart.   Another user of this statement is to preserve values that are received in real-time from a quote page.

read more » Studies:  Transfer from Another Chart

Plot GV Shifted # Bars - Use this statement to place a marker at a position that is shifted leftward.    Example

IF( expression, True Value, False Value)  -  Statements with this general format will return the 2nd parameter's value when the expression flag is True, and return the 3rd parameter value when the expression flag is False.  Several of the statements will evaluate the contents of Global Variable [1] or Global Variable [255] for the expression flag.   Example

Example:   For the task of conditionally incrementing a counter stored in a Global Variable, assume the condition flag is in Global Variable [1] and the counter is in a private Global Variable [200].   This statement would read the Flag from Read GV[1], read the counter in the number field which is the contents of GV[200] and add 1 to it when the Flag is True, and read the counter value in GV[200] and do nothing to change its value when the Flag is False.  Then the result is written to the Write GV which is back into [200].    Thus the value in GV [200] is incremented when the Flag is True, and left unchanged when the Flag is False.

 

read more » DYO:  IF( GV[1], #, Value) Explained

The IF statements that show Index in the expression position, are evaluating the Bar's Index position.   All chart bar's are stored in an array with the first bar on the chart being at Index position 1 and the last bar on the chart being at Index position Bar Count.

The IF statements that show Time in the expression position, are evaluating a Bar's time stamp, where 9:00 a.m. is the number 900, and the time of 14:15 p.m. is the number 1415.

Line x Bar Offset - Inc( Line x Bar Offset) - Use these statements to programatically control the Bar Offset of another line.   This is useful when creating a loop that is referencing prior bars by changing another Line's Bar Offset value to a negative number.   Example

IF expression DO Action - These statements can control several actions in the program that are typically done by the user with mouse clicks on menus or with keyboard strokes.  For example, the action could be to print the chart.

read more » DYO:  IF Flag DO Action Statements

Plot GV in Margin - This statement can be used to plot a Global Varable value or a marker in the right side margin of the chart.  The Number value is the number of bars the marker is shifted to the right beyond the last bar on the chart.

 

 


Last modified 8/26/09 4:28 PM