"KeltnerFlippo classic plus shorting": exit signals
Author: tradercn
Creation Date: 9/5/2014 11:06 PM
profile picture

tradercn

#1
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=11444
Unfortunately, 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.
profile picture

Eugene

#2
Having not seen the actual converted code, we're wondering too. ;)
profile picture

tradercn

#3
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.
profile picture

Eugene

#4
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.
profile picture

tradercn

#5
Alright, thanks for your help. I will recode it. :)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).