Optimisation Fail

Created at 24 Jun 2021, 12:11
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!
KR

kris392001

Joined 06.06.2021

Optimisation Fail
24 Jun 2021, 12:11


Hi All,

I'm trying to test my C# trading framework the Optimisation but it fails giving the right amount of passes but no data (see screenshot). I'm only testing one parameter and there are only 5 values. I've tried other parameters with the same result. There are no errors. I can run 5 passes successfully in backtesting so I know the code is working. I suspect it may have something to do with the way I'm passing the parameters to an instanced Strategy object but can't be sure.

I've posted the relevant code sections as the full code is long. Any help would be appreciated.

Also are there any plans for an Optimisation API to allow runtime optimisiation?

Cheers

Chris

[Parameter("Risk (%)", DefaultValue = 2.0, MinValue = 1.0, MaxValue = 5.0, Step = 1.0, Group = "Risk Management")]
public double RiskPercentage
{
	get { return riskPercentage; }
	set { SetRiskPercentage(value); }
}

private double riskPercentage;

private void SetRiskPercentage(double value)
{
	riskPercentage = value;
	if (Strategy != null) Strategy.RiskPercentage = value / 100;
}

 

 


@kris392001
Replies

PanagiotisCharalampous
24 Jun 2021, 12:15

Hi kris392001,

We will need a complete cBot that reproduces this problem to investigate what is wrong. In the meanwhile, check the logs, you might find some useful information there about what is wrong.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

kris392001
24 Jun 2021, 12:25

Hi Panagiotis,

Thanks for the quick reply. As I'm trying to build a framework with reuseable modules most of the code is in a separate assembly. Can I send you a Visual Studio solution via email?

Cheers

Chris


@kris392001

PanagiotisCharalampous
24 Jun 2021, 12:26

Hi kris392001,

Sure, send it at community@spotware.com. Did you check the logs in the meanwhile?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

kris392001
24 Jun 2021, 12:34

Hi Panagiotis,

I take it by Logs you mean the journals found in Documents/cTrader or cAlgo? In cTrader ther are no current journals and in cAlgo there are no journals at all.

Is there another location?

Cheers

Chris


@kris392001

PanagiotisCharalampous
24 Jun 2021, 12:39 ( Updated at: 21 Dec 2023, 09:22 )

RE:

Hi Chris,

I mean this

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

kris392001
24 Jun 2021, 12:44

Hi Panagiotis,

Unfortunately, as shown in the screenshoot, the log is blank. :(

I'll send the projects.

Cheers

Chris


@kris392001

PanagiotisCharalampous
24 Jun 2021, 12:45

Hi Chris,

You need to click on one of the passes, to get the log for the specific pass.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

kris392001
24 Jun 2021, 12:51

Hi Panagiotis,

Ahhh :) Thanks for your patience. There is the following error:

24/05/2021 21:01:00.229 | Crashed in OnBar with NotSupportedException: Chart operations are not supported in optimization.

So I'm guessing if I enclose any chart operations in a RunningMode.Optimization check, that should fix the issue?

Cheers

Chris


@kris392001

PanagiotisCharalampous
24 Jun 2021, 12:52

Hi Chris,

That's correct :)

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous