Another bug in cTrader automate back-testing? Changing Print statement causes big change in results!

Created at 02 May 2019, 05:22
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!
FI

firemyst

Joined 26.03.2019

Another bug in cTrader automate back-testing? Changing Print statement causes big change in results!
02 May 2019, 05:22


Hi everyone:

This looks like another bug to me using cTrader Automate backtesting.

Notice the discreptancies in the back-testing results when I change string that's to be printed to the LOG tab within the Print statement.

First set of results and the code section that's used:

Code snippet for the results of the first run

The results using the above code snippet

 

Now here's the second set of results with the Print statement changed:

Code changed. See the that only the PRINT statement is modified

After the code change. Look at the huge difference in results!

 

Nothing within that piece of code change should cause such a discreptancy in the back-testing, chart output, and overall performance results.

 

@Panagiotis, if you can send me an email address, I'll email you the bot code that reproduces the above so your team can investigate as I'm not posting the code in its entirety here.

 

Thank you.


@firemyst
Replies

PanagiotisCharalampous
06 May 2019, 11:51

Hi FireMyst,

Send it at community@spotware.com.

Best Regards,

Panagiotis


@PanagiotisCharalampous

firemyst
06 May 2019, 12:20

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Send it at community@spotware.com.

Best Regards,

Panagiotis

Sent. Let me know if you don't receive it.

NOTE! : the attached CS file as some characters in UNICODE format, so if you open the text file in something other than Visual Studio or Notepad++, they may be lost, and they may be part of what's causing the issue.

Description with how to reproduce the issue is embedded within the code with comments.

Thank you.


@firemyst

firemyst
06 May 2019, 12:34

RE: RE:

FireMyst said:

Panagiotis Charalampous said:

Hi FireMyst,

Send it at community@spotware.com.

Best Regards,

Panagiotis

Sent. Let me know if you don't receive it.

NOTE! : the attached CS file as some characters in UNICODE format, so if you open the text file in something other than Visual Studio or Notepad++, they may be lost, and they may be part of what's causing the issue.

Description with how to reproduce the issue is embedded within the code with comments.

Thank you.

PS: the Algo file was sent in a separate email as a "zip" attachment. SO you should receive 2 messages from me :-)


@firemyst

firemyst
07 May 2019, 06:16

Update on this for everyone:

After further investigations with Team Spotware and @Panagiotis , it appears that the root cause of this issue is the "lazy loading" with indicators.

In the above code, there's the following:

if (_zlema.IsInUpTrend) { ... }

However, those property values haven't been loaded yet (the "lazy loading").

 

So above those statements where a _zlema property is first checked, the following code (or similar) needs to be:

var a = _zlema.Result.Last(0);

This ensures all the current property values for the indicator are loaded.

After doing this, the results are the same regardless of which print statement is used.

Thank you.


@firemyst