Recently I converted several strategies on WL4 to be C#. KeltnerFlippo classic plus shorting, after I tune its parameters, it works wonderful. Here is the link:
http://wl4.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=11444Unfortunately, there is a problem so far. It has two statements regarding exit:
1, InstallProfitTarget(1.3);
2, SellAtMarket((Bar + 1), P, "DaysExpired");
Since I changed Days Expired to be 1, in my understanding, that means today I buy stock and tomorrow it will be sold at market open. However, I saw many trades were sold with the first statement rather than the second statement. I am wondering how it could be done with the first statement. My understanding might be wrong. Could you please help? Thanks.
Size:
Color:
Having not seen the actual converted code, we're wondering too. ;)
Size:
Color:
Sorry, here is the code. It included Long and Short previously. Short was removed in the below code.
CODE:
Please log in to see this code.
Size:
Color:
To tell the truth, it's not worth the trouble to get to the bottom of it since WSTL is unsupported. As a workaround, simply install a time-based exit
on top of your profit target and (optionally) comment out the whole SellAtMarket segment below it:
CODE:
Please log in to see this code.
As you can see, WSTL reacts to exit precedence - no more incorrect triggering of profit target.
However, the best solution would be to rewrite the code from scratch.
Size:
Color:
Alright, thanks for your help. I will recode it. :)
Size:
Color: