Hi, was discussed many times here in forum.
You will find lot of articels if you use the search function ... https://www.mql5.com/en/search?keyword=5+digits
only one thing: tp = 65; for a 5 digit (or 3 digit) will be 6.5 points
Same with slippage, Stoploss .. all you calculate with points
Hi, was discussed many times here in forum.
You will find lot of articels if you use the search function ... https://www.mql5.com/en/search?keyword=5+digits
only one thing: tp = 65; for a 5 digit (or 3 digit) will be 6.5 points
Same with slippage, Stoploss .. all you calculate with points
thanks.. those are useful articles yet still can't solve my code's problem there. I've tried to use several ideas but still the code can't work on 5-digits. So, instead of giving me the link, can you please give me a direct idea to the code above?
for(i = 0; i < OrdersTotal(); i++) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break; //---- if(OrderSymbol() == Symbol() && OrderType() == OP_BUY)
This makes the EA incompatible with any other including itself. Always filter by magic numberfor(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair.
- EA's must adjust TP, SL, AND slippage for 5 digit brokers. On ECN brokers you must open and THEN set stops
//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
sob = (kol_buy() < 1 || buy_lev_min - sh*Point > Ask) &&
Another 5- You MUST count down when closing
for(i = 1; i <= kb; i++) { ii = M_ob[i][0]; //---- if(!OrderClose(ii,M_ob[i][2],Bid,slip,White))
WHRoeder, I've tried your advise but still not working. I've change:
//---- if(Bars < 100 || IsTradeAllowed() == false) return(0); sob = (kol_buy() < 1 || buy_lev_min - sh*pips2dbl > Ask) && AccountFreeMargin() > AccountBalance()*0.5; sos = (kol_sell() < 1 || sell_lev_max + sh*pips2dbl < Bid) && AccountFreeMargin() > AccountBalance()*0.5; //----
then I've change:
//---- if(!OrderClose(ii,M_ob[i][2],Bid,slip*pips2points,White)) //---- if(!OrderClose(ii,M_os[i][2], Ask, slip*pips2points, White))
and in ordersend() part, I've also change:
tic = OrderSend(Symbol(), OP_BUY, lotsi, Ask, slip*pips2points, 0, Ask + (tp + 25)*pips2dbl, " ", m, 0, Yellow); tic = OrderSend(Symbol(), OP_SELL, lotsi, Bid, slip*pips2points, 0, Bid - (tp + 25)*pips2dbl, " ", m, 0, Red);
I've tried your suggest number 2 and 3 but EA still 'silent' although the smiley icon is on. Please help.
tic = OrderSend(Symbol(), OP_BUY, lotsi, Ask, slip, 0, Ask + (tp + 25)*Point, " ", m, 0, Yellow); Print("tic_buy=", tic); //---- if(tic==-1) { gle = GetLastError();If the orderSend fails it's supposed to print the last error, but the Print() clears it. move the gle to just below the orderSend or comment out the print. Same with the sell code. Look in the journal tab to see what errors you're getting.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I found this code and it seems only working on 4-digits platform. I don't see a need to change this code but I know I missed something in the algorithm so it won't work on 5-digits platform. So, how to make this code work for 5-digits? Please help and thanks.