HELP in - stop opening multiple order after takeprofit was hit. - page 2

 
05121981:

 it will continue to next process.

i try other code.. https://www.mql5.com/en/forum/138894

still not working. 

Work through this code line by line,  loop cycle by cycle . . .  what is the value of closeT ?
 
RaptorUK:
Work through this code line by line,  loop cycle by cycle . . .  what is the value of closeT ?


i dont have any idea, i try to change all position but still dont work.. could you give me other hint?
 
05121981:

i dont have any idea, i try to change all position but still dont work.. could you give me other hint?
Imagine you have 5 closed orders in the history pool,  what is the first value of  closeT ?  then the next, etc.  If you can't or won't work this out then you should forget coding. 
 
05121981: i dont know what you trying to say, but i found that useful in selecting orders.. https://www.mql5.com/en/forum/139654 
Show me in that post, ANYWHERE, where there is a
!OrderMagicNumber()

Magic number as an int. It makes no sense to negate it. How do you convert a number like 1234567 in to true or false?

Then tell me what

True==magic or False==magic
means
 

thanks guys i found it, but could you check what i done..

i put this code first..

static datetime closeT=0;
  for(int a=OrdersHistoryTotal()-1; a>0; a--)
  {if(OrderSelect(a,SELECT_BY_POS,MODE_HISTORY)==true)
    {if(OrderMagicNumber()==magic && OrderSymbol()==symb && OrderCloseTime()>closeT)
      {
       closeT=OrderCloseTime();
       if(closeT==TimeCurrent() && (buy==true || sell==true)){buy=false; sell=false;}
       Print("closeT: ",closeT,"  TimeCurrent: ",TimeCurrent(),"  a: ",a," HistoryClose: ",OrdersHistoryTotal());
      }
    }
  }

 and then i need to put this code before ordersend..

if(Fun_New_Bar()==false && OrdersTotal()==0)return(0);

 but its working, after takeprofit was hit ea opening order on next bar..

but the problem now is when i put MaxOrder to morethan 10 trades its starting again opening order.