Topic: Stop loss as a function of take profit
it's my first post here and first of all I would like to congratulate the authors of this great code. I started to use it recently and I am very satisfied with it.
When I generate strategies I always try to have the SL at least two times larger than the TP. To (more or less) enforce so, in the "strategy properties" section I choose (for example for M5): SL: 25(min)-70(max) and TP: 5(min)-25(max). Usually I get quite good strategies, however there is a caveat: when I attempt to optimize SL and TP using the walk forward optimization, the SL and TP can get any values within the ±20 steps that I choose in the WF optimizer, and many times, after WFO, SL can be the same as TP or even smaller. For this reason, I have to give up the SL and TP optimization in WFO.
So my question is: is there a way to at least tune the ±20 steps in the WFO by still keeping the range chosen at the beginning in the strategy generation ?
A smarter way to fix this (I think!) is to define the SL as a function of TP, like this:
SL = k * TP
with k that can range (a choice that the user can do), for example, between 1.5 and 2.5. In this way, SL and TP do not move independently from each other and they are correlated, as I think they should be to generate useful strategies. Indeed, with this constrain many bad strategies wouldnt even be screened by the program and the good ones would be preferred. This choice would also solve the problem in the WFO because it is the k parameter to be adjusted, automatically avoiding a SL smaller than TP. Another interesting outcome would be to look at the generated strategies that are more profitable and see if there is an "ideal" multiplying factor for the TP that defines the SL.
Thanks in advance for your answer,