I have an indicator I've used for years that I'm fond of. It has two parts, a primary range plotter and a fib overlay. When I apply this set on a subplot the scaling of the two seems inconsistent. Perhaps I'm missing something basic but I believe there may be an anomaly here. Can anyone else confirm the discrepancy? Code follows:
eKamWhere
Code: Select all
{ how big is today's range, and where are we in that range? }
input:
Comment("");
var: dayRange(0),hi(0),lo(0),
p1(0.382),p2(0.5),p3(0.618),p4(0.786),
bottom(0),top(0),it(0);
hi = HighD(0); lo = LowD(0);
dayRange = hi - lo;
top = dayRange/2;
bottom = -top;
it = bottom + c - lo;
plot1(bottom,"range bottom");
plot2(top, "range top");
plot3(0, "range middle");
var: color(yellow);
if it>it[1] then color=green;
if it<it[1] then color=red;
plot4(it,"now",color);
plot4[1](it[1],"now",color);
Code: Select all
{ plot fib levels within today's range }
input:
fib1(0.214),
fib2(0.382),
fib3(0.618),
fib4(0.786);
var: dayRange(0),hi(0),lo(0),
bottom(0),top(0);
hi = HighD(0); lo = LowD(0);
dayRange = hi - lo;
top = dayRange/2;
bottom = -top;
plot1(bottom + dayRange*fib1, "fib1");
plot2(bottom + dayRange*fib2, "fib2");
plot3(bottom + dayRange*fib3, "fib3");
plot4(bottom + dayRange*fib4, "fib4");