Another bug in cTrader automate back-testing? Changing Print statement causes big change in results!
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:
Now here's the second set of results with the Print statement changed:
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.
Replies
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
PanagiotisCharalampous
06 May 2019, 11:51
Hi FireMyst,
Send it at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous