Fixed horizontal line

i would like please the code for drawing fixed horizontal line.

it will stay in the same position even when i move the chart backward

pirA=150;
pirB=350;
pirC=700;


peakA=IIf(HHV(H,pirA) > HHV(H,pirB) , HHV(H,pirA),IIf(HHV(H,pirB) > HHV(H,pirC),HHV(H,pirB),HHV(H,pirC)));
valleyA=IIf(LLV(L,pirA) < LLV(L,pirB) , LLV(L,pirA),IIf(LLV(L,pirB) < LLV(L,pirC),LLV(L,pirB),LLV(L,pirC)));


side = Param("side",73,0,1000,1);

for( i = 0; i < BarCount; i++ ) 
{
 if(i+side== BarCount) Plot(SelectedValue(peakA), "peakA", colorGreen);
 if(i+side== BarCount) Plot(SelectedValue(valleyA), "valleyA", colorGreen);
 
}


thank you for your help

guys do we have code for Elliott wave ( real one it is worth to be used in Amibroker)

this good so far




N = Param("Days to go back(Excl today)", 10, 2, 200, 1);
PriceStyle = ParamStyle("Chart Type", styleCandle, maskPrice);
LineStyle = ParamStyle("Line Style");

NDayHi = H[BarCount - 1 - N];
NDayLo = L[BarCount - 1 - N];
XH = XL = BarCount - 1 - N;


for(i = BarCount - 1 - N; i < BarCount - 1; i++)
{
if(H[i] > NDayHi)
{
NDayHi = H[i];
XH = i;

}
if(L[i] < NDayLo)
{
NDayLo = L[i];
XL = i;
}
}


// Define the Lines to be drawn

HLine = LineArray(BarCount - 1 - N, NDayHi, BarCount - 2, NDayHi);
LLine = LineArray(BarCount - 1 - N, NDayLo, BarCount - 2, NDayLo);

// Plot chart

Plot(Hline, WriteVal(N, 1.0) + " Day Hi", colorBlack, LineStyle);
Plot(LLine, WriteVal(N, 1.0) + " Day Lo", colorBlue, LineStyle);

this code i did coded it.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.