Hide all indicator data after a certain date

 

I would like to hide all indicators data on the chart after the date of a vertical line drawn (named "RANGE_END").  For example in the following diagrams, left chart is before the vertical line is drawn, right chart is when the vertical line is added, I would like to hide all the data after the line (the zigzag is my own EA, I have written logic to hide, but I want to know how to hide the multiple moving averages indicator).

 
There are two ways to do that.
First, modify each indicator that should react on this line.
Second, make additional indicator for each, like sort of mask. That mask will copy data of original indicator and show data only before the line.

to get line time use ObjectGetInteger(0,"line_name",OBJPROP_TIME,0)

if you need to monitoring line position, use OnChartEvent Function.

if you go by second way and make indicator mask, use iCustom function.


First way much easier, but its required original source of indicator (mq4 or mq5 file).
Indicators have main function OnCalculate and construction inside like this:

for(i=0; i<limit; i++) or  for(int i=start; i<rates_total && !IsStopped(); i++)

this is cycle for calculate each bar value of the line.
modify it by replacing border values for bar index with line.
To get bar index by time easily, use iBarShift function.

 
Your topic has been moved to the section: Technical Indicators
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893