Refreshed indicator lost data

Created at 24 Sep 2019, 07:41
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CA

calgodemo

Joined 28.05.2019

Refreshed indicator lost data
24 Sep 2019, 07:41


Hi all,

I've had my custom indicator running for a few hours and it was drawing things nicely - however I went to check on it just now and everything was erased? 

- What might cause this?

- is there a mechanism to 'back calculate' to bring it up to present date? Can I essentially pick a date in the past and run the indicator to present and then keep going live? When I launch the indicator it only calculates forward, even though some of the nested indicators (like macd or sma) are drawn for hours before the current time.

 

Thanks!

 

CaD

 

 


@calgodemo
Replies

PanagiotisCharalampous
24 Sep 2019, 08:25

Hi calgodemo,

Can you share the indicator code? All indicators are calculated for all data available on the chart so "back calculate" mechanism you are looking for is there by design.

Best Regards,

Panagiotis


@PanagiotisCharalampous

calgodemo
24 Sep 2019, 19:22

RE:

Panagiotis Charalampous said:

Hi calgodemo,

Can you share the indicator code? All indicators are calculated for all data available on the chart so "back calculate" mechanism you are looking for is there by design.

Best Regards,

Panagiotis

Thanks Panagiotis, that's what I thought! And that's my experience with indicators - even my own.

I tell you what I did - on initialization I set my LastIndex integer to Marketseries.close -2... then in the following code

if (index > Lastindex)
            {
                OnBarClosed(Lastindex, index_special);
                Lastindex = index;
            }

it only calculated from the last candle ... when I changed LastIndex to 0 on initialization, it behaved like it should and I got the calculations for all available data on the chart like you said.

Not sure what I was thinking when i wrote that but it's corrected now!

Thanks again!

 

CaD

 


@calgodemo