Hi, I made this indicator for you. Try applying as an overlay. Let me know if that works for you.
Paul ------------- //RD stands for recession date StartRD1 = 1050101; EndRD1 = 1050631; StartRD2 = 1000401; EndRD2 = 1030101; StartRD3 = 1070701; EndRD3 = 1090301; isRecession = (DateNum()>=StartRD1 AND DateNum()<=EndRD1) OR (DateNum()>=StartRD2 AND DateNum()<=EndRD2) OR (DateNum()>=StartRD3 AND DateNum()<=EndRD3); myATR = ATR(50); recBarColor = Param("RecessionColorNum", 25,16,55,1); rOpen = IIf(isRecession,Open,Open); rHigh = IIf(isRecession,High+5*myATR,High); rLow = IIf(isRecession,Low-5*myATR,Low); rClose = IIf(isRecession,Close,Close); PlotOHLC( rOpen, rHigh, rLow, rClose, "RecessionOverlay", recBarColor, styleCandle); --- In amibroker@yahoogroups.com, "bistrader" <bistra...@...> wrote: > > I would like to create an overlay afl that has recession periods in a color that can be selected via parameter with default of light gray. I can come up with the beginning and ending dates for each period, but am not how to proceed. Getting lost on how to best define (i.e., maybe 1 if in recession and 0 otherwise) and how to best plot. Help appreciated. >