How to hide MA line from chart on button click

 
Hello,
I'm new to mql5. I'm doing this as a practice project.

I need help on, how to hide the MA line from chart when I click on the button which I've implemented to my custom indicator.

I tried by turning the MA line to the same color as the chart background color. But the line is still showing on top of the candlesticks (see the screenshot)

Please tell me,
1. how to draw the line in the background of the candles ?
2. if there's a better way to achieve this ?
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
{
        if(id == CHARTEVENT_OBJECT_CLICK && sparam == button_hide)
                {
                        if(ButtonState == false)
                         {
                                long chart_background=ChartGetInteger(chart_ID, CHART_COLOR_BACKGROUND);
                                PlotIndexSetInteger(0, PLOT_LINE_COLOR, int(chart_background));
                                ButtonState=true;
                        }
                        else
                        {
                              if(ButtonState == true)
                                {
                                PlotIndexSetInteger(0, PLOT_LINE_COLOR, clrBlue);
                                ButtonState = false;
                                }
                        }
               }
}
Files:
 

Try:

ChartSetInteger(0, CHART_FOREGROUND, true);
 
ra121pl #:

Try:

Thank you!
Reason: