Error in optimization

Created at 11 Feb 2019, 20:47
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!
PO

pozhy

Joined 03.04.2018

Error in optimization
11 Feb 2019, 20:47


I write a Robot and when I want to optimize it I face an error "Crashed in OnBar with NotSupportedException: Chart operations are not supported in optimization".I move the code from onBar() method to onTick() I got the same error. what is the problem?

 

11/01/2019 00:00:00.000 | Backtesting started
11/01/2019 02:00:00.000 | Crashed in OnTick with NotSupportedException: Chart operations are not supported in optimization
11/01/2019 02:00:00.000 | Backtesting was stopped

 

 


@pozhy
Replies

PanagiotisCharalampous
12 Feb 2019, 09:28

Hi pozhy,

As the message says, you are using operations that are not supported in optimization. Do you draw objects on charts?

Best Regards,

Panagiotis


@PanagiotisCharalampous

contact.bitq
11 Apr 2020, 13:29

I faced this issue today, here solution
I pass RunningMode of cBot as indicator's parameter.
and then in the indicator:
if (cBotRunningMode != RunningMode.Optimization) {
  // do chart operation here
}

 


@contact.bitq