How to set paramtoggle on off , i am try not working

//CLOUD EMA //

Modified = ParamToggle("CLOUD EMA","Off|On",0);
amv0=Volume*(O+H+L+C)/4;
line=Sum(amv0,50)/Sum(Volume,50);
Plot(line,"Modified",41,1);
CG=MA(C,14);
Plot(cg,"A",10,1);
holdline=HHV(CG,3);
PlotOHLC(Holdline,Cg,Holdline,Cg,"",25,styleCloud);

//end Cloud ema //

I don't know which one you want to toggle on/off but you get the idea in below example...

Modified = ParamToggle("CLOUD EMA","Off|On",0);

amv0=Volume*(O+H+L+C)/4;
line=Sum(amv0,50)/Sum(Volume,50);
CG=MA(C,14);
holdline=HHV(CG,3);

Plot(cg,"A",10,1);
PlotOHLC(Holdline,Cg,Holdline,Cg,"",25,styleCloud);
if ( Modified ) 
   Plot(line,"Modified",41,1);

If you want to toggle on/off the other two plots too then move them within if statement too.

Modified = ParamToggle("CLOUD EMA","Off|On",0);

amv0=Volume*(O+H+L+C)/4;
line=Sum(amv0,50)/Sum(Volume,50);
CG=MA(C,14);
holdline=HHV(CG,3);

if ( Modified ) {
   Plot(line,"Modified",41,1);
   Plot(cg,"A",10,1);
   PlotOHLC(Holdline,Cg,Holdline,Cg,"",25,styleCloud);
}
1 Like

if( True ) way.

Modified = ParamToggle("CLOUD EMA","Off|On",0);
If ( Modified ) {
    amv0=Volume*(O+H+L+C)/4;
    line=Sum(amv0,50)/Sum(Volume,50);
    Plot(line,"Modified",41,1);
}

CG=MA(C,14);
Plot(cg,"A",10,1);
holdline=HHV(CG,3);
PlotOHLC(Holdline,Cg,Holdline,Cg,"",25,styleCloud);
1 Like