trade.SetDeviationInPoints() is that what i needed. Solved my problem
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
Hello, I have readed the documentation but didn't understand.
Is there any valid way to set slippage limit using CTRADE library on MQL5 ? Should i edit the function in library?
Is that m_request.deviation ? Is that in points or pips any clue ?
Regards
trade.Buy(LotSize,_MySymbol,entryPrice,StopLoss,TakeProfit,TradeCommentCombi); //+------------------------------------------------------------------+ bool CTrade::PositionOpen(const string symbol,const ENUM_ORDER_TYPE order_type,const double volume, const double price,const double sl,const double tp,const string comment) { //--- check stopped if(IsStopped(__FUNCTION__)) return(false); //--- clean ClearStructures(); //--- check if(order_type!=ORDER_TYPE_BUY && order_type!=ORDER_TYPE_SELL) { m_result.retcode=TRADE_RETCODE_INVALID; m_result.comment="Invalid order type"; return(false); } //--- setting request m_request.action =TRADE_ACTION_DEAL; m_request.symbol =symbol; m_request.magic =m_magic; m_request.volume =volume; m_request.type =order_type; m_request.price =price; m_request.sl =sl; m_request.tp =tp; m_request.deviation=m_deviation; //--- check order type if(!OrderTypeCheck(symbol)) return(false); //--- check filling if(!FillingCheck(symbol)) return(false); m_request.comment=comment; //--- action and return the result return(OrderSend(m_request,m_result)); } //+------------------------------------------------------------------+