Thanks in advance
Inputs: Length(20),BarsPlus(0),TLMALen(5),
upcolor(blue),dncolor(red),
upcolorMA(blue),dncolorMA(red);
Variables:TL(0), TLMA(0);
TL = TimeSeriesForecast(Length, BarsPlus);
TLMA = XAverage(TL, TLMALen);
If TL >= TLMA then begin
Plot1(TL, "TL", upcolor);
Plot2(TLMA, "TLMA", upcolorMA);
SETPLOTBGCOLOR (1, upcolor) ;
end else begin
Plot1(TL, "TL", dncolor);
Plot2(TLMA, "TLMA", dncolorMA);
SETPLOTBGCOLOR (1, dncolor) ;
end;
Begin
If TL >= TLMA and Close >= TLMA then
Plot3 (Close, "Bar Close Up", upcolor);
If TL <= TLMA and Close >= TLMA then
Plot3 (Close, "Bar Close Up", upcolor);
end;
Begin
If TL <= TLMA and Close <= TLMA then
Plot4 (Close, "Bar Close Dn", dncolor);
If TL >= TLMA and Close <= TLMA then
Plot4 (Close, "Bar Close Dn", dncolor);
end;
Comment