Changes
Cross
,no edit summary
Returns a value of <syntaxhighlight>[[True</syntaxhighlight> ]] if, on the current bar, the plot of a numerical expression A crossed the plot of a numerical expression B in the specified direction.
The plot of A is defined as having crossed <syntaxhighlight>[[Above</syntaxhighlight> ]] or <syntaxhighlight>[[Over</syntaxhighlight> ]] the plot of B if the value of A is greater than the value of B and one of the following is true:
a) The value of A was less than the value of B on the bar immediately preceding the current bar
b) The values of A and B were equal for a consecutive sequence of one or more bars immediately preceding the current bar and the value of A was less than the value of B on the bar immediately preceding this sequence of bars.
The plot of A is defined as having crossed <syntaxhighlight>[[Below</syntaxhighlight> ]] or <syntaxhighlight>[[Under</syntaxhighlight> ]] the plot of B if the value of A is less than the value of B and one of the following is true:
a) The value of A was more than the value of B on the bar immediately preceding the current bar,
<syntaxhighlight>Plot1 Cross Direction Plot2</syntaxhighlight>
Where: <syntaxhighlight>[[E</syntaxhighlight> ]] - a numerical expression <syntaxhighlight>[[Direction</syntaxhighlight> ]] - a required parameter; specifies the direction of the cross
==== Example ====
<syntaxhighlight>Trigger an alert on the bar where the Close price crosses above 1350.00:
If Plot1 Cross Above 1350.50 Then
Alert("Price has crossed above 1350.00");</syntaxhighlight>