Support Board
Date/Time: Thu, 28 Nov 2024 23:48:53 +0000
Post From: sc.GetBarHasClosedStatus from another chart different time frame ACSIL
[2023-03-25 12:45:19] |
User431178 - Posts: 544 |
Here is a clue from what you posted above if (BarIndex != ArraySize - 1) return BHCS_BAR_HAS_CLOSED; sc.GetBarHasClosedStatus() From the information linked above The very last bar in the chart is never considered a closed bar until there is a new bar added to the chart. It is not possible to know otherwise because of the following reasons: The chart bars are based upon a variable timeframe like Number of Trades or Volume and the ending can never be known until there is a new bar, or because there is not a trade at the very final second of a fixed time bar.
BHCS_BAR_HAS_CLOSED: Element at BarIndex has closed. This will always be returned for any bar in the chart other than the last bar in the chart.
Get the arraysize from the reference chart, if the bar you are checking is less than arraysize-1 the bar is closed. |