BarStatus: Difference between revisions
From MultiCharts
(→Usage) |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Returns a numerical value, indicating the status of the most recent tick in the current bar of the specified data series. | Returns a numerical value, indicating the status of the most recent tick in the current bar of the specified data series. | ||
A value of 0 indicates that the tick is the opening tick of the bar, 1 indicates that the tick is within the bar, and 2 indicates that the tick is the closing tick of the bar. | |||
A value of 0 indicates that the tick is the opening tick of the bar, 1 indicates that the tick is within the bar, and 2 indicates that the tick is the closing tick of the bar. | |||
'''[[AllowSendOrdersAlways|AllowSendOrdersAlways]]''' set to True allows order generation even when barstatus is not defined (-1 will be returned). | |||
== Usage == | |||
<syntaxhighlight>BarStatus(DataNum)</syntaxhighlight> | <syntaxhighlight>BarStatus(DataNum)</syntaxhighlight> | ||
Where: | Where: | ||
:'''DataNum''' - a numerical expression specifying the data number of the series. | |||
If | If DataNum is not specified, a value for the current data series will be returned. | ||
== Example == | |||
<syntaxhighlight>BarStatus(1) | <syntaxhighlight>BarStatus(1)</syntaxhighlight> | ||
Will return a value of 2 if the current tick in the data series with the data number 1 is the closing tick of a bar. | |||
<syntaxhighlight> | |||
if BarStatus(1) = 2 then | |||
Print("This is the closing tick of the bar."); | |||
</syntaxhighlight> | |||
Will print the specified message on the last tick of the current bar. | |||
[[Category:Data Information/General]] | [[Category:Data Information/General]] |
Latest revision as of 18:25, 12 August 2014
Returns a numerical value, indicating the status of the most recent tick in the current bar of the specified data series.
A value of 0 indicates that the tick is the opening tick of the bar, 1 indicates that the tick is within the bar, and 2 indicates that the tick is the closing tick of the bar.
AllowSendOrdersAlways set to True allows order generation even when barstatus is not defined (-1 will be returned).
Usage
BarStatus(DataNum)
Where:
- DataNum - a numerical expression specifying the data number of the series.
If DataNum is not specified, a value for the current data series will be returned.
Example
BarStatus(1)
Will return a value of 2 if the current tick in the data series with the data number 1 is the closing tick of a bar.
if BarStatus(1) = 2 then
Print("This is the closing tick of the bar.");
Will print the specified message on the last tick of the current bar.