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

Re: Overlapping ranges



PureBytes Links

Trading Reference Links

Phillip,

Have you checked the candlestick functions. I believe that they are already 
in the package.

David

From: Philip <pschmi02@xxxxxxxxxxx>
Reply-To: metastock@xxxxxxxxxxxxx
To: metastock@xxxxxxxxxxxxx
Subject: Overlapping ranges
Date: Mon, 27 Mar 2000 12:23:29 -0500

Greetings All,

I'd like to enlist your help writing code for "overlapping" price bars.
(see GIF)  (Could the formula already exist somewhere and I'm not aware
of it?)  Seems like a concept that might also interest other market
students, but maybe my view is myopic.

Situation:  Today's range should overlap yesterday's range (GIF) and as
I search for such situations, I want to set the requirement for how
large the overlap should be.  How to determine the overlap and how to
quantify it . . . perhaps as a percentage of the previous day's range??

I've made a start below, but a) I don't know whether my approach would
hold water, b) even if I'm on the right track, I still can't quite tie
the ends together -- I think I need some "If" statements next, c) is
there an easier/better way?


LL:= L < Ref(L,-1) and H < Ref(H,-1)

HH:=H > Ref(H,-1) and L > Ref(L,-1)

IN:=L > Ref(L,-1) and H < Ref(H,-1)

OUT:= H > Ref(H,-1) and L < Ref(L,-1)

OVERLAP-LL:= (H-L) - (Ref(L,-1)-L)

OVERLAP-HH:= (H-L) - (H - Ref(H,-1))

OVERLAP-IN:= H-L  (?)  maybe just (H-L) is enough in this case

OVERLAP-OUT:= H-L (?)  as in OVERLAP-IN, this may be sufficient for the
purpose

I thought I might simply divide yesterday's range by the amount of
OVERLAP, using the quotient as a parameter I would specify in my
explorations/experts etc.:  a high quotient would indicate very little
overlap, and progressively lower quotients would indicate progressively
larger overlaps.  If the quotient equaled 1, the entire range would
overlap, if the quotient equaled 6, only 1/6 of the range would overlap.

QUOTIENT-LL:= Ref(H,-1)-Ref(L,-1) / OVERLAP-LL

QUOTIENT-HH:= Ref(H,-1)-Ref(L,-1) / OVERLAP-HH

OVERLAP-IN:= Ref(H,-1)-Ref(L,-1) / H-L  (seems like the simplest of all
the variants)

OVERLAP-OUT:= Ref(H,-1)-Ref(L,-1) / H-L  (also seems simple, it would
always result in a

quotient of less than 1)

The next step, I believe, would be to set up "If" statements for the
whole shebang so I can just say:  identify set ups where today's range
overlaps yesterday's range by 60%,  45% . . . whatever.  This part has
me entirely stumped.

What's left of the ole gray matter feels like a Gordian knot.  "Hey,
Alex!  Get over here with that sword of yours, man!"

Philip
<< Overlap.gif >>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com