Stop And Reverse Trailing Stop

 

Does it make sense to anyone that an EA that is supposed to stop and reverse whenever the trailing stop is hit would do so several times within a minute every minute whether the trailing stop is set to trail at 30 pips, 300 pips, or even 3000 pips on the GBP/JPY H4 timeframe?

I have an EA that's doing just that and an EA builder who's telling me there's nothing wrong with it.

 
I don't understand what TS_in_Pips have to do with Time-Frame. If the TS was 3-Pips, I could imagine that being hit several times within a minute. Ah-ha, perhaps you have a Pip/Point issue.
 
ubzen:
I don't understand what TS_in_Pips have to do with Time-Frame. If the TS was 3-Pips, I could imagine that being hit several times within a minute. Ah-ha, perhaps you have a Pip/Point issue.


Thank you very much for your reply.

I don't know what a pip/point issue is but I'll be sure to ask if the problem isn't resolved.

 

Pip/Point issue, 4/5 Digits issue. If the dealer price is 1.54321 ----> it'll be a 5-digit broker because there are 5-digits after the decimal point. If the dealer price is 1.5432 ----> it'll be a 4-digit broker. For Jpy pair its usually 2/3 digits. Given the above example using the OrderSend() the Slippage of 3 would mean 3-Pips on a 4-digit broker. But would mean 3-Points on a 5-digit broker. In order to make them the same distance, you'll have to specify 3 for a 4-digit broker and 30 for a 5-digit broker.

If this is what you are experiencing, when you specify 30 for stop-loss it acts more like 1.54321 minus .00030 on a 5-digit broker which only means 3-pips in general. And acts as 1.5432 minus .0030 on a 4-digit broker which means 30-pips in general. This is pretty much like Forex ABC, one needs to understand what is a Pip.

All in all, I'm not sure this really is your problem because you haven't shown any codes. I was just brain storming the likely suspect.

 

Agree. JPY is 2/3 and metals can be 0/1.

Always adjust for 4/5 digit brokers, TP, SL, AND slippage

//++++ These are adjusted for 5 digit brokers.
int     pips2points;    // slippage  3 pips    3=points    30=points
double  pips2dbl;       // Stoploss 15 pips    0.015      0.0150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int     init(){                                                     
     if (Digits % 2 == 1){      // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
//---- These are adjusted for 5 digit brokers.
    /* On ECN brokers you must open first and THEN set stops
    int ticket = OrderSend(..., 0,0,...)
    if (ticket < 0)
       Alert("OrderSend failed: ", GetLastError());
    else if (!OrderSelect(ticket, SELECT_BY_TICKET))
       Alert("OrderSelect failed: ", GetLastError());
    else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0)
       Alert("OrderModify failed: ", GetLastError());
     */
Reason: