I'm writing an indicator for pattern recognition.
The indicator looks for lower highs and it starts looking for an high and marks it with a dot.
But if an higher high occurs I want to mark this recent one as the high and erase provious plotted dot.
This is the code but it doesn't erase previous dots
Code: Select all
if stato = 0 and High[1] > Highest(High[2],20) and High < High[1] then
begin
stato = 1;
barCount = 0;
PVH1 = High[1];
PVH1Pos = BarNumber;
Plot1[BarNumber - PVH1Pos + 1](PVH1,"1");
Print("Trovato 1 il ", Date);
end;
if stato = 1 then
begin
barCount = barCount + 1;
if barCount > numBarreReset then stato = 0;
if high > PVH1 then begin
NoPlot(1);
PVH1 = high;
Plot1[high-1](PVH1, "1");
end;