Refreshed indicator lost data
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
Replies
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
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