Hello! everyone,
I've just updated from 6.20 to 6.30 and found that a piece of code about ApplyStops don't work anymore, but they work perfectly well in 6.20. Do I make some mistakes? How can I make it work in 6.30? Please help me! Thank you!
This is my code:
First of all the code is incorrect. I don't even mean that it is incomplete (missing original Buy/Sell statements so people simply can't use the code to reproduce the problem and as such code you posted is useless without tinkering with it). But why do you call Equity(1, 0 ) then you call Flip() then you call ApplyStops? Equity() call is not needed.
As to the ExitAtStop=2, only today I have found that there was an unintended change in the code that caused ExitAtStop = 2 mode together with backtestRegular not to generate any exits in 6.25.0...6.30.0. This will need to be addressed in next update.
There are 2 workarounds as of now:
use SetBacktestMode( backtestRegularRaw );
OR
use ExitAtStop = 1
General reminder: any issues with given version should be reported to either:
Thank you! Tomasz,
I removed Equity(1,0)), and add activationFloor=0 and change ExitAtStop to 1, and it works. Problem solved.
And I seed your reminder. Thank you.