
How to start with MQL5
- 2020.12.19
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
whats worng at my code ?
i have 2 strategy and i want differenf magic num and ticket num for each
void OnTick() { //--- //------SEND OREDER BY RSI ------------- int rsival=iRSI(_Symbol,_Period,14,PRICE_HIGH); double rsiarry[]; ArraySetAsSeries(rsiarry,true); CopyBuffer(rsival,0,0,4,rsiarry) if(rsiarry[0]>70) { MqlTradeRequest request={0}; MqlTradeResult result={0}; //--- parameters of request request.action =TRADE_ACTION_DEAL; request.symbol =_Symbol; request.volume =0.1; request.sl =SL; request.tp =TP; request.type =ORDER_TYPE_BUY; request.price =Ask(SYM); request.deviation=10; request.magic =2222; result.order =orderRSIticket; } //------SEND OREDER BY CCI ------------- int CCIval=iCCI(_Symbol,_Period,14,PRICE_HIGH); double CCIarry[]; ArraySetAsSeries(CCIarry,true); CopyBuffer(CCIval,0,0,4,CCIarry) if(CCIarry[0]>70) { MqlTradeRequest request={0}; MqlTradeResult result={0}; //--- parameters of request request.action =TRADE_ACTION_DEAL; request.symbol =_Symbol; request.volume =0.1; request.sl =SL; request.tp =TP; request.type =ORDER_TYPE_BUY; request.price =Ask(SYM); request.deviation=10; request.magic =4444; result.order =orderCCIticket; } } //+------------------------------------------------------------------+
Netanel Tanami:
hi
at MQL4 the send order was very simple
i wirte this and i get the order ticket and i set the magic number
now i try to move for MQL5 and i dont understand how i send a order and get the ticket number and set the magin number
i tried to do this but nothing happend
You forget main part.
OrderSend(request,result);

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
hi
at MQL4 the send order was very simple
i wirte this and i get the order ticket and i set the magic number
now i try to move for MQL5 and i dont understand how i send a order and get the ticket number and set the magin number
i tried to do this but nothing happend