Arbitrary / random appearance and disappearance of the indicator lines or indicator window in visual mode of EA

Marine  

Hi forum-ists,

I need “trial an error” to get a line or indicator panel of the incorporated indicators to show up on the visualized chart.

Used:

Indicators, here ATR am MA (see enclosed source code).

  1. Working in the visual mode and visual mode-box on.
  2. There are NO templates of this form in the template map: <EA_name>.tpl, tester.tpl or default.tpl.
  3. Timeframe I use is normally: day

Mostly the first time when I start the test the indicator line and indicator panel is visible. The next time it’s mostly gone.

Restart of the platform gives the lines and panel. After starting the next test run they disappeared again.

Changing the period to 1 or 2 min mostly gives visibility of indicator line and panel. These timeframes give no problems the line and the panel stay visible.

Changing back to timeframe to for instance 12 min or day the line and panel disappear.

Sometime switching the visible box on/off helps for (just) one test run.

I enclose the sources for reproduction.


//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2020, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+

//------------ variabelen voor indicatoren ---------------
input bool B_MA = false;
input int B_MA_period = 20;
input ENUM_MA_METHOD D_Moving_average_method = MODE_SMA;

double   iATR_index[];
int      ATRControlPanel_handle;
double   ATRData[];

double   iMA_index [];
int      IMAControlPanel_handle;
double   IMAData[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
//*********************************INTIATION ATR INDICATOR HANDLES ****************************
   ATRControlPanel_handle = iATR(_Symbol,0, 14);   // Getting the Control Panel/Handle for ATR
   if(ATRControlPanel_handle < 0)
     {
      Print("*** Couldn't Create ATRControlPanel_handle: ", GetLastError(), " ***");
      return(-1);
     }
//*********************************INTIATION MA INDICATOR HANDLES ****************************
   IMAControlPanel_handle = iMA(_Symbol,0,B_MA_period,0,MODE_SMA, PRICE_CLOSE);
   if(IMAControlPanel_handle < 0)
     {
      Print("***  IMAControlPanel_handle: ", GetLastError(), " ***");
      return(-1);
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   IndicatorRelease(ATRControlPanel_handle);
   IndicatorRelease(IMAControlPanel_handle);
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   return;
  }
//+------------------------------------------------------------------+

Does anyone have the same problem? Do I make a wrong assumption? Do I make a mistake? Is there a solution to see the lines always as should be the case?

By the way, I know - if I wish - to pruposefully switch off and on the lines by the TesterHideIndicators() command.

Sicerly Marine

William Roeder  
Marine: Does anyone have the same problem? Do I make a wrong assumption? Do I make a mistake? Is there a solution to see the lines always as should be the case?

EAs have no eyes; they don't need to see the indicator on the chart. If you want to see them, you put them on the chart.

Set up the chart the way you want and save a template.

Marine  

Hi William

I appreciate your answer but that’s not the promise of MT5. I know that EA’s don’t have eyes 😉.

For accurate testing the indicator in the EA must without any doubt adopt and have the values from the input section of the EA.

In the past I have tested (in MT4) many times and found that the values of the indicator in the template was not consistent with the values in the EA. The reason was I forgot to change the values.

A certain amount of time for investigation was lost because of that.

So there is now a possibility to erase that potential failure because MT5 on this point has better possibilities. But this possibility gives until now a "somewhat" unstable impression.

So I still have my question.

Sincerly, Marine

Marine  

Hi Wiliam,

To be honest: you offered a workaround. Although know to me as you can read here above.

If MT5 has in fact a failure / irregularity on this point, would it be advisable to bring this to the helpdesk or is this the procedure you have followed already?

Sincerely, Marine

Reason: