Paul, Thanks.
Two items. First, I would like the overlay to extend from the top to the bottom of the chart. Is there a way to do this? I remember seeing a chart someplace that did this but can not find it. Second, I would like to place the state date and end date for each recession in a csv, but is there a way to read the start and end dates (from column A and B, respectively) into the arrays that you have? Thanks Bert --- In [email protected], "notanaiqgenius" <notanaiqgen...@...> wrote: > > 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 [email protected], "bistrader" <bistrader@> 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. > > >
