Use Moving average as stop loss

Avatar
  • updated
  • Planned (collecting votes)

Idea

The idea is pretty simple so maybe there is already a way to implement this. I want to use the value of a Moving average (e.g. 200 EMA) to set the stop loss. The idea is the following:

  • Let’s say we get an entry signal at price 100.
  • Let the 200EMA be 80.
  • Then I want to set the Stop Loss (constant) at 80 having a SL of 100-80=20 Points.
  • The Take Profit should be the Stop Loss Times a factor that I would like to define (e.g. 1,5). In this particular case, this would mean: 20*1,5 = 30.
  • Hence I would set the Take Profit to 100+30 = 130.

I know, that crossing the 200EMA can simply be set as closing condition. However, that has two disadvantages:

  1. The EA will always take the current value of the EMA and not the value when the trade was entered.
  2. I don’t know, how I would set the Take profit for the strategy described above.

Why?

There are a many trading strategies (e.g. based on MACD based entry) that work with the distance to an EMA to set the stop loss (and also TP based on fixed risk/reward ratio). Backtests have shown that it can be profitable with a win rate of 50-60% and profit/risk ratio~1,5. So this could be an interesting, non-martingale approach to make profit in the long run.

Implementation

I believe that it could be implemented quite easily (or at least easier than some other ideas that I have in mind :-)) based on the current MAs that are already in the EA. If it is indeed a new feature and community likes the idea, I will gladly propose a logical implementation approach. 

Avatar
0
Andrey Khatimlianskyi
  • Under review

Hendrik,

I like idea with TP as coefficient to the SL.


But I'm not sure I understand the idea with fixed SL based on the distance to the MA at the moment of deal open.

Why not to trail SL? What is the sense of the distance from the price to the MA at some point of time?

Avatar
0
hendrik dubbe

Hey Andrey,

thanks for your reply. I agree, that setting the TP based as a coefficient to the SL would indeed be a nice feature. However, with the current functionalities, I don't think that this gives you any more degrees of freedom. At the moment, I can define SL and TP as fixed values or as volatility times a factor. This is already really neat, especially the volatility feature has been a huge step and thank you for that great work! Now if we want so set a fixed value for TP = SL*factor, I can already do this by setting the fixed values for TP and SL or the volatility coefficients accordingly. It may have some advantages during parameter optimization (keep constant SL/TP and, for example, just fit SL). However, it will not enable oneself to implement a new kind of strategy.

There are some strategies out there, that specifically use indicators like MA, parabolic SAR (I know you’re not a fan😊) and so on as a SL. This can either be done trailing (always use current value of the indicator) or at the moment when you enter the trade. This, at the moment can only be done when using the respective indicator as a close condition. However, in this case it is not possible to set a fixed TP/SL ratio which is key to some of those strategies.  

Avatar
0
Andrey Khatimlianskyi
  • Planned (collecting votes)
Quote from hendrik dubbe

Hey Andrey,

thanks for your reply. I agree, that setting the TP based as a coefficient to the SL would indeed be a nice feature. However, with the current functionalities, I don't think that this gives you any more degrees of freedom. At the moment, I can define SL and TP as fixed values or as volatility times a factor. This is already really neat, especially the volatility feature has been a huge step and thank you for that great work! Now if we want so set a fixed value for TP = SL*factor, I can already do this by setting the fixed values for TP and SL or the volatility coefficients accordingly. It may have some advantages during parameter optimization (keep constant SL/TP and, for example, just fit SL). However, it will not enable oneself to implement a new kind of strategy.

There are some strategies out there, that specifically use indicators like MA, parabolic SAR (I know you’re not a fan😊) and so on as a SL. This can either be done trailing (always use current value of the indicator) or at the moment when you enter the trade. This, at the moment can only be done when using the respective indicator as a close condition. However, in this case it is not possible to set a fixed TP/SL ratio which is key to some of those strategies.  

Still can't understand: what is the sense of the distance from the price to the MA at some point of time?

This distance was actual at that point. But why should we use it now?

Never mind, your idea is clear and have the right to be implemented )

So, let's vote.

Avatar
0
Ulises Cune

Why not use the "Close Individual" as a "Stop Loss"?

Avatar
0
Andrey Khatimlianskyi
Quote from Ulises Cune

Why not use the "Close Individual" as a "Stop Loss"?

Read the initial post.