EA continues to run after the Autotrading button is pressed to disable it

 

The subject says it.  742 is the build.

I did search but didn't find anything about it.   When I click to disable Autotrading, the EA continues to run.  I even took the EA off and replaced it on the chart, enabled it and disable it and it continues to take ticks and process as though Autotrading was enabled.   

Then I replaced the EA with another and the problem continued.

I also stopped and re-started the terminal and re-enabled and disabled autotrading and the EA again continued. 

Any suggestions (besides the power cord trick)? 

sn 

 
serpentsnoir:

The subject says it.  742 is the build.

I did search but didn't find anything about it.   When I click to disable Autotrading, the EA continues to run.  I even took the EA off and replaced it on the chart, enabled it and disable it and it continues to take ticks and process as though Autotrading was enabled.   

Then I replaced the EA with another and the problem continued.

I also stopped and re-started the terminal and re-enabled and disabled autotrading and the EA again continued. 

Any suggestions (besides the power cord trick)? 

sn 

Run to where ?, can you keep up and catch it ? ;D


1. Are you sure that you have nothing like some sort of fake tick generator running on background, perhaps on MT4 ?. 

2. Re-start the PC, open just one MT5 (no MT4), open just one chart, attach standard MT5 EA like ExpertMACD.mq5 and enable Auto Trading, then do you still have the same problem ?

Some of us know how to make EA running without tick on no trading days (weekend/holiday/etc), but lets see what you have first. 

 
Running or processing signals?
Note that autotrading button stops trading but the EA remains "alive".
 

This block of code produces the output from the Print statement while the EA is disabled.

 

void OnTick()
  {
//return;
//---
// Trade Enabled?
   if(GBL_terminal.IsTradeAllowed())
     {
      GBL_Symbol.RefreshRates();
      GBL_Symbol.Refresh();
        {
         //++ Manage Open Position
         //    Set Take Profit?
         //    Set Trailing Stop?
         if(_UseTrailingStopFixed)
           {
            // Print("Using Trailing Stop.");
            if(TrailingStopFixedManager())
              {

              }
           }
         if(_UseTrailingStopSAR)
           {
            // Print("Using Trailing Stop.");
            if(TrailingStopSARManager())
              {

              }
           }
         if(_UseScalp)
           {
            // Print("Using Scalp.");
            if(ScalpManager())
              {

              }
           }
        }
     }

   CheckForTrades();
   Print("Exit OnTick.");
   return;
  }

 

 
serpentsnoir:

This block of code produces the output from the Print statement while the EA is disabled.

 

 

Oh that ;D, I thought this was something else, - this is not something new. 

When we attach EA to chart, every time there's a tick coming in, OnTick is always executed. Even when we open EA property (press F7) or disable auto trading, OnTick is still and will be always executed. If we disable auto trading the only thing that is not executed is Trade Functions, we'll get error 10027 : TRADE_RETCODE_CLIENT_DISABLES_AT : auto trading dissable by trading terminal

Read this also and try my code Will a static variable lose its value when EA restart from disconecting?.

 

Nice! thank you very much.

 
great!
Reason: