pds = 10;
prt = 20;
hv = HHV(C, pds);
lv = LLV(C, pds);
dx = (hv-lv)/prt;
for(i=0; i<prt; i++)
Plot(lv+i*dx, "prt", colorWhite, styleDashed | stylenotitle);
I appreciate for your reply. Plotting works fine but i couldnt create buy-sell signals.. In order to integrate your formulation i added buy-sell signals but it didnt work. Where did i make mistake?
pds = 500;
prt = 20;
hv = HHV(C, pds);
lv = LLV(C, pds);
dx = (hv-lv)/prt;
for(i=0; i<prt; i++)
Plot(lv+i*dx, "prt", colorWhite, styleDashed | styleNoTitle);
EMAX=EMA(C,20);
Plot(EMAX , "EMAx" , colorGreen , styleLine);
Buy=Cover= Cross(EMAX,(lv+i*dx));
Sell=Short=Cross((lv+i*dx),EMAX);
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);
Short = Sell;
Cover = Buy;
// Plot arrows
shape = Buy * shapeUpArrow + Short * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );