If you are on a 5 Digit Broker 1 pip = 10 points . . . 4/5 Digits
Try this
extern double TP=25; extern double SL=25; extern bool Four_digit_broker=false; if(Four_digit_broker==false){double StopMultd=10;}else{StopMultd=1;} double nsl=SL*StopMultd; double ntp=TP*StopMultd; ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-nsl*Point,Ask+ntp*Point,"My order #2",16384,0,Green);
tonny:
Try this
Try this
Don't use an external, you forget to change when you change brokers or the broker changes digits, there goes your money.
EA's must 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(){ OptInitialization(); if (Digits % 2 == 1){ // DE30=1/JPY=3/EURUSD=5 https://www.mql5.com/en/forum/135345 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()); */
Comments that do not relate to this topic, have been moved to "Off-topic MT4/mql4 questions.".

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Is there any way to takeprofit in pips?
My base currency is GBP and im trading EURUSD.
If I set my takeprofit as 25, it will close the order at 25GBP profit when i really want 25pip profit.
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
Thanks for any help.