Custom BigTrade, how to save candle position?

Hello, good morning. I’m creating a BigTrade indicator and adding other features to it. It works well and gives me the same values ​​as NinjaTrader’s OF Trade Detector, but my question is how NinjaTrader saves the position of each BigTrade? If I refresh the chart, my indicator disappears and has to wait for another candle to detect a BigTrade before it reappears. However, NinjaTrader does show the circle where a BigTrade was detected. I want to do the same with my indicator. Thank you.

Data saved to a file will survive indicator reset. There are couple of ways to write to a file I am using File.ReadAllLines to read and StreamWriter to write (writer.WriteLine)

Have you tried setting your indicator to calculate on each tick instead of on bar close?

Calculate = Calculate.OnEachTick;

If that doesn’t work for you, I would ask what timeframe you are running your indicator on and are you basing your calculations on the tick stream? I have a similar indicator and this what I use:

protected override void OnStateChange()
{
            if (State == State.SetDefaults)
            {
                ...
                Calculate = Calculate.OnEachTick;
                ...
            }
            else if (State == State.Configure)
            {
                AddDataSeries(BarsPeriodType.Tick, 1);
            }
           ...

I am guessing that he is using onmarketdata() which is realtime only