DIVIDE 20 EQUAL PARTS BETWEEN HHL AND LLV..

#1
HOW CAN I EASILY DIVIDE BETWEEN HHV AND LLV TO EQUAL 20 PARTS AND PLOT ALL THESE 19 SEPERATERS SHORTLY? AND THESE 19 SEPERATORS WİLL BE USED İN BUY AND SELL ACTION.. I WAS CALCULATING AND PLOTING ALL THESE SEPERATORS ONE BY ONE BUT DEFINING ALL THESE AS PARAMATERS AND PLOT THEM ONE BY ONE KEEPS SO LONG.. I HOPE THERE MUST BE AN EASY WAY.

THANX FOR YOUR HELPS..
 
Last edited:
#4
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 ) );
 

Similar threads