I have an indicator which works on Calculate.OnBarClose. Essentially it counts bars when a condition (Close[0] <= Low[2]) is true and it almost always uses the close as part of that condition except for the final count, where either the open or the close can be used to fulfil that condition. I did explore IsFirstTickOfBar in the help guide but that only works in Calculate.OnPriceChange or Calculate.OnEachTick.
Seeing that it wasn't workable, would the following alternative work?
On the second last count, let's say the count is 12, can I expose this variable to another script/indicator which performs calculations on Calculate.OnPriceChange, so that the new indicator can pull data from the original indicator at the open of the next bar? This should pass on the data that the count is already on a 12 count on the previous bar at the open. At the same time, it can also determine whether the open of the current bar is fulfils the 13th count.
Would this logic work? Have I missed anything? How would I expose the 12th count if it is workable?
Regards
Kay Wai

Comment