George
Here is one way you could try...
// background vis a vis MA(c,200);
p = Param("period", 200, 10, 200, 10);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);
Plot(C,"", colorWhite, 64);
Plot( MA(C,p),"", IIf(Cond1, colorBlue,IIf(Cond2,colorRed,colorBlack)),1);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);
Plot(Param("Height",100,1,100,1),"",IIf(Cond1,
colorRed,IIf(Cond2,colorBlue,colorBlack)
),styleArea|styleOwnScale|styleNoTitle|styleNoLabel|styleNoRescale,0,100);
Plot( MA(C,p),"", colorRed,1);
SetChartBkColor(colorBlack);
SetChartOptions(1,0,1);
Use the Param function to adjust the period.
Use the Height Param to adjust from full height to ribbon.
Change the colors to suit.
ChrisB
george_siris wrote:
>
>
> Hi all,
>
> Is it possible to do the following ?
>
> if condition A then color of chart's background is Red
> if condition B then color of chart's background is Blue
>
> thanks
>
> _