I do not know what is "order_id" in orderclose.
Please help me!
Thank everybody! :))
Can you show me an example, please.
Thank everybody! :))
Can you show me an example, please.
My EA just do 1 order per time. So, please show me the code close it when the conditon done.
Thank!!
My EA just do 1 order per time. So, please show me the code close it when the conditon done.
Thank!!
There is no EA closing several trades the same moment..... It is always done one by one
How to close correctly selected trades read Loops and Closing or Deleting Orders
Please tell me what's wrong with my code!! Thank.
<SNIP>
Please tell me what's wrong with my code!! Thank.
Please use this to post code . . . it makes it easier to read.
for(i=1; i<=OrdersTotal(); i++)
Please tell me what's wrong with my code!! Thank.
Did you bother to read the thread I gave a link to ?
@Raptor:
Yes, But i harly undertood because i just star to write EA. Sr for bother you.
int start() { int i ,times; double DIPlus1; double DIPlus0; double DIMinus1; double DIMinus0; double Main1; double Main0; double MACD_main; double MACD_signal; double Rsi; double err = 25; int MagicNumber1=220101,MagicNumber2=220102; //---- //--- DIPlus1=iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,1); DIPlus0=iADX(NULL,0,14,PRICE_CLOSE,MODE_PLUSDI,0); DIMinus1=iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,1); DIMinus0=iADX(NULL,0,14,PRICE_CLOSE,MODE_MINUSDI,0); Main1=iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,1); Main0=iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,0); Rsi = iRSI(NULL,0,14,PRICE_CLOSE,0); times = Minute() % 15 ==0 && Seconds() ==0; //MACD_main = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); //MACD_signal = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0); //---- if(Minute() % 15 ==0 && Seconds() ==0) { if( Main0 > err && Main1 < err && DIPlus0 > DIMinus0 && Rsi < 70 ) OrderSend(Symbol(),OP_BUY,0.03,Ask,5,Ask-300*Point,Ask+300*Point,"","",1,Blue); if (Main0 > err && Main1 < err && DIPlus0 < DIMinus0 && Rsi > 30) OrderSend(Symbol(),OP_SELL,0.03,Bid,5,Bid+300*Point ,Bid-300*Point,"","",2,Red); //--- if(OrdersTotal()>0) { for(i=1; i<=OrdersTotal(); i++) { if (OrderSelect(i-1,SELECT_BY_POS)==true) { if(Rsi >=70 ) OrderClose(OrderTicket(),OrderLots(),Bid,2,Green); if( DIPlus1 > DIMinus1 ) OrderClose(OrderTicket(),OrderLots(),Bid,2,Green); if(Rsi <=30 ) OrderClose(OrderTicket(),OrderLots(),Ask,1,Green); if( DIPlus1 < DIMinus1 ) OrderClose(OrderTicket(),OrderLots(),Ask,1,Green); } } } } return(0); }
I don't understand why my order close instantly after it star.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I do not know what is "order_id" in orderclose.
Please help me!