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

Overlapping ranges



PureBytes Links

Trading Reference Links

<x-html><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Greetings All,
<p>I'd like to enlist your help writing code for "overlapping" price bars.&nbsp;
(see GIF)&nbsp; (Could the formula already exist somewhere and I'm not
aware of it?)&nbsp; Seems like a concept that might also interest other
market students, but maybe my view is myopic.
<p>Situation:&nbsp; 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.&nbsp; How to determine the overlap and
how to quantify it . . . perhaps as a percentage of the previous day's
range??
<p>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?
<br>&nbsp;
<p>LL:= L &lt; Ref(L,-1) and H &lt; Ref(H,-1)
<p>HH:=H > Ref(H,-1) and L > Ref(L,-1)
<p>IN:=L > Ref(L,-1) and H &lt; Ref(H,-1)
<p>OUT:= H > Ref(H,-1) and L &lt; Ref(L,-1)
<p>OVERLAP-LL:= (H-L) - (Ref(L,-1)-L)
<p>OVERLAP-HH:= (H-L) - (H - Ref(H,-1))
<p>OVERLAP-IN:= H-L&nbsp; (?)&nbsp; maybe just (H-L) is enough in this
case
<p>OVERLAP-OUT:= H-L (?)&nbsp; as in OVERLAP-IN, this may be sufficient
for the purpose
<p>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.:&nbsp; a high quotient would indicate very little overlap, and progressively
lower quotients would indicate progressively larger overlaps.&nbsp; If
the quotient equaled 1, the entire range would overlap, if the quotient
equaled 6, only 1/6 of the range would overlap.
<p>QUOTIENT-LL:= Ref(H,-1)-Ref(L,-1) / OVERLAP-LL
<p>QUOTIENT-HH:= Ref(H,-1)-Ref(L,-1) / OVERLAP-HH
<p>OVERLAP-IN:= Ref(H,-1)-Ref(L,-1) / H-L&nbsp; (seems like the simplest
of all the variants)
<p>OVERLAP-OUT:= Ref(H,-1)-Ref(L,-1) / H-L&nbsp; (also seems simple, it
would always result in a
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
quotient of less than 1)
<p>The next step, I believe, would be to set up "If" statements for the
whole shebang so I can just say:&nbsp; identify set ups where today's range
overlaps yesterday's range by 60%,&nbsp; 45% . . . whatever.&nbsp; This
part has me entirely stumped.
<p>What's <b><i><font color="#3333FF">left</font></i> </b>of the ole gray
matter feels like a Gordian knot.&nbsp; "Hey, Alex!&nbsp; Get over here
with that sword of yours, man!"
<p>Philip</html>
</x-html>
Attachment Converted: "f:\eudora\attach\Overlap.gif"