Refresh Custom Indicator

Created at 18 May 2020, 10:08
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!
EY

eynt

Joined 08.05.2020

Refresh Custom Indicator
18 May 2020, 10:08


I've created a custom indicator which has it's own public variables and properties which are calculated based on the chart bars however it does not has an IndicatorDataSeries output (usually called 'Result' on the code samples).

When I place it on a chart, it calculate itself on all history bars and on each new tick which is exactly the way I want it to perform.

The problem begins when I use it from my cBot - the Calculate method is never called - not on history and not on new ticks. The only way I found to bypass it is to add a IndicatorDataSeries output parameter which i called Result and from the my cBot call on each tick call MyInd.Result.LastValue. This makes the indicator acts OK.

Is there a more simple way to make the indicator calculate itself without adding an unnecessary parameter and call it on each tick?

 

Thanks

 

 

 


@eynt
Replies

PanagiotisCharalampous
18 May 2020, 10:43

Hi Yuval,

Calculate is a public function hence you can call it yourself from the cBot if you want.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous