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

ELA help



PureBytes Links

Trading Reference Links

I'm attempting to write a showme for 5 minute bars that indicates if prior
days have been narrow in range.  As currently written the code indicated
everyday is such.  Anybody seem where I'm going wrong?

Thanks for any ideas.
===============================
{showme plots when prior days are narrow in range.
5 minute bars.}

Vars:
NR7(false),           {narrowest range day in last seven}
NR3Days(false),   {last three days have had significantly lower range than
normal}
RangeD(0),          {calculates yesterday's range from intraday data}
OK2Enter(false);    {flags today as following narrow range days}

RangeD = HighD(1) - LowD(1);        {calculate Range from intraday data}
If RangeD = Lowest(RangeD, 7) then NR7 = true;;
If Average(RangeD,3) < Average(RangeD,20)*.33 then NR3Days = true;


If D > D[1] then begin
 If (NR7 or NR3Days) then
  OK2Enter = true;
 If OK2Enter then
  Plot1(HighD(1),"NRD");
 end;

If Time = Sess1EndTime then OK2Enter = false;