Hello,
i am trying to mirror the chart from the selected bar.

My code is this, but it doesn't plot a chart but only a single bar.
Can someone see what is wrong. It is difficult for me to describe in
english how the mirroring idea works, but maybe the code shows it.

Thank you.

selectedBI  = SelectedValue(BarIndex()); WriteVal(SelectedBI);
mirroropen  = 0;
mirrorhigh  = 0;
mirrorlow   = 0;
mirrorclose = 0;
WriteVal(BarCount-SelectedBI-1);

for (i = 0;i<BarCount-1;i++);
{
if(i>=selectedBI)
{
mirroropen[i]  =  2*Avg[SelectedBI] - O[2*SelectedBI-i];
mirrorhigh[i]  =  2*Avg[SelectedBI] - H[2*SelectedBI-i];
mirrorlow[i]   =  2*Avg[SelectedBI] - L[2*SelectedBI-i];
mirrorclose[i] =  2*Avg[SelectedBI] - C[2*SelectedBI-i];
}
else
{
mirroropen[i]  =  O[i];
mirrorhigh[i]  =  H[i];
mirrorlow[i]   =  L[i];
mirrorclose[i] =  C[i];
}
}



PlotOHLC(mirroropen, mirrorhigh, mirrorlow, mirrorclose,
"Mirrorchart", colorBlue);


Reply via email to