I am writing an indicator that calculates the cumulative delta for the day. The input data is in the Tick timeframe and consists of Date, Time, Price, Volume and Direction (Long or Short). Since NinjaTrader has no field for Direction, I created a PostgreSQL database to hold all this information. I calculate the cumulative delta and plot the result.
The indicator works fine if I use the 1-Tick timeframe on the Chart. In any other timeframe, the results are wrong. NinjaTrader is doing everything as if it was on the 1-Tick timeframe. For instance, if I use a 1-minute Chart, it thinks the first minute candle has the volume of the first Tick on the database, the second minute candle has the volume of the second Tick on the database and so on.
What can I do so NinjaTrader deals with the information of Cumulative Delta the same way it deals with any data that is native to NinjaTrader (such as Date, Time, Price or Volume)? Is there any way to synchronize a variable to the Tick timetrame in such a way that when we change the timeframe, the information is adjusted to fit the new timeframe? Should I use something to accumulate the results depending on the chart type? What if I use Renko?”
Thank you.
Claudio
Comment