within AddBar() there is the option to add Bid/Ask values as well.
I’d like to store in one of those values (e.g. within Ask) a different parameter that is calculated within OnDataPoint.
More specific: OnDataPoint is calculating a value of bar size that is rounded to tickvalue when plotted. I need to recover the not-rounded value to the strategy, to avoid double calculation on every tick (+ avoid some other issues).This needs to work in backtest as well.
When doing the following in the BarType
AddBar(bars, lastBarClose, lastBarClose, lastBarClose, lastBarClose, lastBarTime, lastBarVolume, bid, ask);
Print(ask);
Nevertheless, using GetCurrentAsk(0) or Bars.GetAsk(0) from a strategy, I am not able to recover the value (MyValue) that I stored in the “ask” of the BarType.
How could I achieve this? Or is there a completely different way?
Thank you in advance
Martin

Comment