limiting EA for order sending

 
  1. That is what you coded. Fix your broken code.
  2. Check for open orders or a change in signals.
    int start(){
       static datetime time0; datetime prev0=time0; time0=Time[0]; bool isNewBar = prev0 != time0;
       if(isNewBar){
          static double level; double prev = level; level = ...;
          bool wasSignal = prev  > x;
          bool  isSignal = level > x
          if(isSignal && ! wasSignal) ...

Reason: