It is stunning for that one EA still work after I have removed it from the chart,why?

 

Its code is very simple and is below:

if(OrdersTotal()==0)
   {
   Print(OrderSend(Symbol(),OP_BUY,0.5,Ask,3,Bid-7*Point,Ask+20*Point,"OP_BUY",0,0,Red));
   Print(GetLastError());
   }
 the code means send order one time . 

 I have attached it on the chart some time and then i removed it.

but i find it still work. what more it send order twice.

it is really amazing. 

 

in addition, whether EA works or not after close MT4? 

 
vx0532:

Its code is very simple and is below:

 the code means send order one time . 

 I have attached it on the chart some time and then i removed it.

but i find it still work. what more it send order twice.

No,  it won't do that,  when you remove it from a chart it is no longer running . . .  perhaps you attached it to 2 charts.  Check the experts tab/log to find out.
 
vx0532:

Its code is very simple and is below:

 the code means send order one time . 

 I have attached it on the chart some time and then i removed it

Only call GetLastError()  when you have a need to,  i.e.  when you have an error,  read this:  What are Function return values ? How do I use them ?
 
RaptorUK:
No,  it won't do that,  when you remove it from a chart it is no longer running . . .  perhaps you attached it to 2 charts.  Check the experts tab/log to find out.



Just as you said.

Thanks a lot!