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.
(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.
<p>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??
<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>
<p>LL:= L < Ref(L,-1) and H < Ref(H,-1)
<p>HH:=H > Ref(H,-1) and L > Ref(L,-1)
<p>IN:=L > Ref(L,-1) and H < Ref(H,-1)
<p>OUT:= H > Ref(H,-1) and L < 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 (?) maybe just (H-L) is enough in this
case
<p>OVERLAP-OUT:= H-L (?) 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.: 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.
<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 (seems like the simplest
of all the variants)
<p>OVERLAP-OUT:= Ref(H,-1)-Ref(L,-1) / H-L (also seems simple, it
would always result in a
<br>
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: identify set ups where today's range
overlaps yesterday's range by 60%, 45% . . . whatever. 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. "Hey, Alex! Get over here
with that sword of yours, man!"
<p>Philip</html>
</x-html>
Attachment Converted: "f:\eudora\attach\Overlap.gif"
|