How to remove Indicator line on Strategy tester in Visual Mode

 

Hello,

In my MQL5 Expert Advisor I use iMA function to create Movie averages needed for logic. These MA lines are plotted using ObjectCreate() function using price and time values data generated with iMA. When I try to Backtest this EA in Visual Mode on Strategy tester these lines automatically show up on charts. I tried to use ObjectDelete() function as well I tried to disable function that draws these line by using appropriate flag in Tester Mode but still these lines show up on Tester as soon I start BackTesting.

I would appreciate if someone suggest me on how to suppress / remove these line during MT5 Backtesting in Visual mode?

I am attaching the Chart screen shot where there are other lines other than drawn by iMA.

Files:
indLines.jpg  62 kb
 

Simple modify the indicator code to not use graphical objects and use buffers instead.

You will not be able to optimise or do non-visual back-tests with graphical objects anyway, so use buffers instead.

 
Ashok Nale:

Hello,

In my MQL5 Expert Advisor I use iMA function to create Movie averages needed for logic. These MA lines are plotted using ObjectCreate() function using price and time values data generated with iMA. When I try to Backtest this EA in Visual Mode on Strategy tester these lines automatically show up on charts. I tried to use ObjectDelete() function as well I tried to disable function that draws these line by using appropriate flag in Tester Mode but still these lines show up on Tester as soon I start BackTesting.

I would appreciate if someone suggest me on how to suppress / remove these line during MT5 Backtesting in Visual mode?

I am attaching the Chart screen shot where there are other lines other than drawn by iMA.

iMA lines are not drawn with objects, they are built-in indicator buffers, you can't remove them in visual mode.
 
Ashok Nale:

...as well I tried to disable function that draws these line by using appropriate flag in Tester Mode but still these lines show up on Tester as soon I start BackTesting.


It is not entirely clear from your post if you've tried it or not-

Add the following to the top of your OnInit() function-

TesterHideIndicators(true);
 
AMI289 #:

It is not entirely clear from your post if you've tried it or not-

Add the following to the top of your OnInit() function-

Thanks.

TesterHideIndicators(true);

works.

 

Three people answered. Each one of us interpreted the query differently. Only the last answer was the correct solution.

It proves that if you don't state your issue clearly, properly and in detail, you can easily get misunderstood and get an incorrect response.

Reason: