forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Forum

Forex Software, Forex Strategies, Expert Advisors Generator

You are not logged in. Please login or register.

Forex Forum → Technical Matters → Stop loss as a function of take profit

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 3

Topic: Stop loss as a function of take profit

Dear all,

    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,

Re: Stop loss as a function of take profit

Hello Ivaninfante,

Welcome to the forum!

Is a strategy si good or no it is determined by the Acceptance Criteria. Having that in mind, the Optimizer, WFA, Normalizer do their best to find the higher profit (or whatever goal is set) by keeping the strategy good.

> "I always try to have the SL at least two times larger than the TP"

20 years ago I read all the books about training and tried to do what they say. However many of the ideas there were questionable or even contradictory. That's why I created FSB Pro and EA Studio for myself to find what really works and what doesn't.

So, I want to ask you why do you want to have SL twice higher than TP? I'm sure that many books state that TP should be twice higher than SL.

If you spend more time with the Generator, you will find that it really tends to set TP lower. However, it is no because it has a special filling that creates better strategies. It is just statistically easier to reach higher profit on historical data with a tight TP. It gives a better chance to take benefits of every price move on the historical data. We call that curve-fitting.

I suggest you to not use TP at all for the beginning. If you want to use it, do not optimize it.

Re: Stop loss as a function of take profit

I agree with Miroslav.

All too often I see people attempt to use FSB Pro and EA Studio with pre-conceived ideologies which is where I think many people fall over.

Trust the software. Ignore what you think you know. The strategies that are presented will give you your answer.

Instead of digging "down in the weeds" of individual strategies SL/TP, indicators etc you should be focusing your attention at the portfolio level: assembling a large portfolio, diversified across many assets, managing your strategies and your risk.

If you do this it will not matter that one individual strategies equity curve takes a hit because its SL is twice its TP, instead it will be offset by your other (uncorrelated) strategies.

Co-founder - Blue Capital Trading (
Need help managing a portfolio of hundreds of trading strategies? Check out Strategy Samurai

Posts: 3

Pages 1

You must login or register to post a reply

Forex Forum → Technical Matters → Stop loss as a function of take profit

Similar topics in this forum