PDA

View Full Version : How to test when we move to a new bar


richard
06-20-2006, 08:07 PM
Hi. I am running an indicator where I have set CalculateOnBarClose=true. I believe this means that OnBarUpdate() will only fire when the present bar closes.

However, I have initialized

MarketData.MarketDataItem += new MarketDataItemEventHandler(MarketData_MarketDataIt em);

so I am processing incoming tick data.

When I set CalculateOnBarClose = true, my DrawText() statements to bar = 0, will not draw the text on the current bar, but the bar before. It will only draw on the current bar if I set CalculateOnBarClose=false. But then, the OnBarUpdate() event fires on every tick.

My question is if I set CalculateOnBarClose=false, is there a way for me to tell when the current bar will close and we are moving to the next bar in the OnBarUpdate() event?

Thank you.

NinjaTrader_Ray
06-21-2006, 12:10 AM
Not in NT5. We have added a FirstTickOfBar property to NT6 strategies and will consider doing the same for indicators.

richard
06-21-2006, 01:53 AM
OK. Thank you.