[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Showme for Double tops and Bottoms



PureBytes Links

Trading Reference Links

I wrote a showme to mark nonconsecutive double tops and bottoms in intraday 
charts. (Consecutive DTs, and DBs are trivial: if H = H[1} then ... .) This was 
my first extensive use of loops and arrays, so I'd be happy to have comments 
about a more efficient or more elegant way to do this. 

I continue to be amazed at Easy Language--is it true that there is no 
logical negation in it?

Thanks,
Sandy Morton


{ *DoubleTopBottom - a showme to mark nonconsecutive double tops and bottoms 
                     in intraday charts during RTH.
                   - use in ten minute charts, increase array size for faster 
                     charts }
Array: Hi[46](0), Lo[46](0);
Variable: ti(0), cnt(0), notfound(true);
ti = TimetoMinutes(time);

{ double tops }
cnt = 0;
if ti > 570 and ti < 965 then begin { 9:30 -- 4:15 }
 notfound = true;
 while Hi[cnt] > 0 and notfound begin
  if H = Hi[cnt] then begin
   plot1(H+0.50, "DT");
   notfound = false;
  end;
  cnt = cnt + 1;
 end;
 if notfound then Hi[cnt] = H;
end
else if Hi[0] > 0 then begin { reset each day }
 cnt = 0;
 while Hi[cnt] > 0 begin
  Hi[cnt] = 0;
  cnt = cnt + 1;
 end;
end;

{ double bottoms }
cnt = 0;
if ti > 570 and ti < 965 then begin { 9:30 -- 4:15 }
 notfound = true;
 while Lo[cnt] > 0 and notfound begin
  if L = Lo[cnt] then begin
   plot2(L-0.50, "DB");
   notfound = false;
  end;
  cnt = cnt + 1;
 end;
 if notfound then Lo[cnt] = L;
end
else if Lo[0] > 0 then begin { reset each day }
 cnt = 0;
 while Lo[cnt] > 0 begin
  Lo[cnt] = 0;
  cnt = cnt + 1;
 end;
end;