QuickTip 75 | Difference between Condition1 = C > O; and If C > O then Condition1 = TRUE;

2 years ago
13

Quicktip 75 uses a TradeStation EasyLanguage show-me study to demonstrate the difference between:

Condition1 = Close > Open;
//and
If Close > Open then Condition2 = TRUE;
With the first expression (Condition1 = Close > Open;) if close is greater than open (i.e an up bar) the expression evaluates to true and Condition1 is set to TRUE, hence, in our simple example a show me dot is plotted at the high of the bar. If Close is less than or equal to open (i.e a down bar or Doji) then the expression, Close > Open evaluates to FALSE, Condition1 is set to False and the show-me dot is not plotted.

With the second expression, If Close > Open then Condition2 = TRUE; if the close is greater than the open (an ‘up’ bar) then Condition2 is set to true and a show-me dot is plotted at the low of the bar. If on a subsequent bar the close is less than or equal to open (i.e a down bar or Doji) then no change is made to Condition2. Hence once there has been an up bar Condition2 is set to true and remains true for all future bars and a show-me dot would be plotted at the low of these bars. This second expression acts as a sort of ‘ratchet.’

The third example is similar to the second in that if a bar is an ‘up’ bar then Condition3 is set to true, however if the bar becomes or is a down bar or Doji Condition3 is set to false. Therefore the first and third expressions give similar results.

Loading comments...