I am chooing entry based on MA crossover, do you have suggestion for the exit ?

 

Hi all,

I feel it is a good strategy to enter/open order using Moving Average Crossover (MA20,MA50,MA100,MA200 ).

However, i don't think it is a good strategy to exit by Moving Average Crossover

Any of you have a better idea for the exit strategy ? using TP and SL ? using MACD crossover ?

How about using time exit strategy ? where if the MA is in H1 chart, the order will be closed after xx hour no matter win lose . How do you think ?

Thanks

From

erekit

https://www.mql5.com/go?link=http://100k2.blogspot.com//

 
erekit:

Hi all,

I feel it is a good strategy to enter/open order using Moving Average Crossover (MA20,MA50,MA100,MA200 ).

However, i don't think it is a good strategy to exit by Moving Average Crossover

Any of you have a better idea for the exit strategy ? using TP and SL ? using MACD crossover ?

How about using time exit strategy ? where if the MA is in H1 chart, the order will be closed after xx hour no matter win lose . How do you think ?

Thanks

From

erekit

https://www.mql5.com/go?link=http://100k2.blogspot.com//

I use a combination of fixed pip trailing stop and SAR, whichever is closer to the current price, with all my entry strategies, which include SAR, MA-cross, AO+AC, MACD, RVI, OsMA divergence and Heiken Ashi Zone Trade.
 

Hi engcomp,

You are using so much strategy for entry. Do you program your own EA ? Is it working well ?

No worry, I will not ask to get your EA. Just interested to know how well is the entry and exit strategy you used.

To me, using trailingstop though can reduce us from loss risk but it also limits the TP.

 
erekit:

Hi engcomp,

You are using so much strategy for entry. Do you program your own EA ? Is it working well ?

It's very simple. I developed a template where all components that are common to all EAs are proven to work, for example:

count_position(), CloseAll(), CloseLongs(), CloseShorts(), SetStops(), SetTrailingStops(), CheckForClose(), OpenLong(), OpenShort(), etc.

I set the global variables for the strategy in start() and program the entry strategy in a function called get_signal().

The template also includes functions for money management, Call_MM(), and facilitates control over the EA while running.

For example, you may not want it to take a new position but still manage the exit strategy. Or you may want to add a position manually.

The template is working well. Some of the strategies can be improved with the introduction of filters.

All the components I use are freely available on this very generous forum, which has been the source of my template.

 

Thanks for the great tips.

I guess I myself need to start develop the template with the components as you did

from last time till now, I usually write from scratch

 
engcomp:

It's very simple. I developed a template where all components that are common to all EAs are proven to work, for example:

count_position(), CloseAll(), CloseLongs(), CloseShorts(), SetStops(), SetTrailingStops(), CheckForClose(), OpenLong(), OpenShort(), etc.

I set the global variables for the strategy in start() and program the entry strategy in a function called get_signal().

The template also includes functions for money management, Call_MM(), and facilitates control over the EA while running.

For example, you may not want it to take a new position but still manage the exit strategy. Or you may want to add a position manually.

The template is working well. Some of the strategies can be improved with the introduction of filters.

All the components I use are freely available on this very generous forum, which has been the source of my template.

Excuse me Engcomp, I'm new here and i'm just learning to develop EA, could you kindly post the link where to find the components you use?

Thank you very much.

 
mick_79:

Excuse me Engcomp, I'm new here and i'm just learning to develop EA, could you kindly post the link where to find the components you use?

Thank you very much.

At the top-right there is a search box. Try the component name first; if that doesn't produce results, try different names using your imagination.
 
erekit:

To me, using trailingstop though can reduce us from loss risk but it also limits the TP.

Very correct. I find setting trailingstops the most challenging part in optimizing an EA.

Set it too close and you could be knocked out from a great trend.

Set it too far and you are giving back too much in a short trend.

In my opinion, parabolic SAR is an excellent model for intelligent stops. Not perfect but excellent.

Anyone knows a better model, please let us know.

 
erekit:

Thanks for the great tips.

I guess I myself need to start develop the template with the components as you did

from last time till now, I usually write from scratch

Maybe my answer on this link will help? https://forum.mql4.com/32798#335201
 
Bollinger bands also make for good Dynamic stop prices. I have been looking at Sar recently because of the way it uses recent swing hi or low price points.
 

engcomp:

In my opinion, parabolic SAR is an excellent model for intelligent stops. Not perfect but excellent.

Anyone knows a better model, please let us know.

And I find SAR just abysmal. I'm currently using combination of ATR stops and low previous bars.
  1. stopATR = Bid - SL.Trail.ATR*ATR.value;
    See also ATRStops_v1 [ 1 ]. 1 - MQL4 Code Base
  2. // once per bar
    static int  LBcntB=3,   LBcntS=3;
    if (High[1] > High[2])  LBcntB = MathMax(SL.bars.Minimum, LBcntB-2);
    else                    LBcntB++;
    if ( Low[1] <  Low[2])  LBcntS = MathMax(SL.bars.Minimum, LBcntS-2);
    else                    LBcntS++;
    
    H.H = High[Highest(NULL,0, MODE_HIGH, LBcntS, 0)];  // stop.bars
    L.L =  Low[ Lowest(NULL,0, MODE_LOW,  LBcntB, 0)];  // stop.bars
    
    ...
    stop.bars   = MathMin(Low[0], L.L)
                - SL.Extra.Pips*pips2dbl - SL.Extra.ATR*ATR.value;
    
Current working values:
extern int      SL.bars.Minimum         =   3;
extern double   SL.Extra.ATR            =   0.1;
extern int      SL.Extra.Pips           =   1;
extern double   SL.Trail.ATR            =   2.8;
extern int      ATR.Period              =  29;
Reason: