Difference between revisions of "Below"
Jump to navigation
Jump to search
(2 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
== Notes == | == Notes == | ||
The plot of A is defined as having crossed Below the plot of B if the value of A is less than the value of B and one of the following is true: | The plot of A is defined as having crossed Below the plot of B if the value of A is less than the value of B and one of the following is true: | ||
− | + | *The value of A was more than the value of B on the bar immediately preceding the current bar, | |
or | or | ||
− | + | *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 more than the value of B on the bar immediately preceding this sequence of bars. | |
For more information see [[Cross]]. | For more information see [[Cross]]. | ||
== Examples == | == Examples == | ||
− | Trigger an alert on the bar where the Close price crosses below 1350.00: | + | Trigger an alert on the bar where the Close price crosses below 1350.00: |
− | <syntaxhighlight>Plot1(Close); | + | <syntaxhighlight>Plot1(Close); |
If Plot1 Cross Below 1350.50 Then | If Plot1 Cross Below 1350.50 Then | ||
Line 30: | Line 30: | ||
To open a short position if a 5-period moving average crosses below a 10-period moving average: | To open a short position if a 5-period moving average crosses below a 10-period moving average: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | + | If (Average(Close, 5) cross below Average(Close, 10)) then | |
− | SellShort ("ES") 1 contracts next bar at | + | SellShort ("ES") 1 contracts next bar at Market; |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Comparisons and Loops]] | [[Category:Comparisons and Loops]] |
Latest revision as of 11:15, 27 February 2012
Used in combination with Cross to specify the direction of the cross. Below specifies a downward (greater to a lesser value) direction.
Usage
Plot1 Cross Below Plot2
or
E1 Cross Below E2
Where:
- E - a numerical expression.
Notes
The plot of A is defined as having crossed Below the plot of B if the value of A is less than the value of B and one of the following is true:
- The value of A was more than the value of B on the bar immediately preceding the current bar,
or
- 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 more than the value of B on the bar immediately preceding this sequence of bars.
For more information see Cross.
Examples
Trigger an alert on the bar where the Close price crosses below 1350.00:
Plot1(Close);
If Plot1 Cross Below 1350.50 Then
Alert("Price has crossed below 1350.00");
To open a short position if a 5-period moving average crosses below a 10-period moving average:
If (Average(Close, 5) cross below Average(Close, 10)) then
SellShort ("ES") 1 contracts next bar at Market;