This function lets you specify the minimum or maximum number of chart bars that must exist between the last occurrence of a given event (buy/sell order opening) and the current chart bar.
Syntax | bars_since(order_event) | ||
---|---|---|---|
Parameters | order_event | Order event. It can be any of these keywords: BUY , SELL or ANY . | |
BUY | Extracts number of chart bars since last buy order opening bar. | ||
SELL | Extracts number of chart bars since last sell order opening bar. | ||
ANY | Extracts number of chart bars since last buy or sell order opening bar. | ||
Single-sided | No | ||
Notes | This function must be combined with VAL function in order to perform numeric comparisons. | ||
Example | bars_since(BUY)>VAL(5) | ||
This example tells JedeyeFX that for the condition to be true, there must be at least more than 5 chart bars without any buy order opened since the bar where the last opened buy order did occur. This ensures that buy orders will open with a minimum interval of 5 bars between them. |