Please any one give
an example to check the trade request before sending with the function OrderCheck().
- What is the problem of this code?
- 8 Hours Pivot
- Help finishing EA, Full Code and specific errors attached
From class CTrade:
bool CTrade::PositionOpen(const string symbol,ENUM_ORDER_TYPE order_type,double volume, double price,double sl,double tp,const string comment) { string action,result; //--- ClearStructures(); //--- checking 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; m_request.type_filling=m_type_filling; m_request.comment =comment; //--- order check if(!OrderCheck(m_request,m_check_result)) { m_result.retcode=m_check_result.retcode; printf(__FUNCTION__+": %s [%s]",FormatRequest(action,m_request),FormatRequestResult(result,m_request,m_result)); //--- copy return code return(false); } //--- order send if(!OrderSend(m_request,m_result)) { printf(__FUNCTION__+": %s [%s]",FormatRequest(action,m_request),FormatRequestResult(result,m_request,m_result)); return(false); } printf(__FUNCTION__+": %s [%s]",FormatRequest(action,m_request),FormatRequestResult(result,m_request,m_result)); //--- ok return(true); }
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