PureBytes Links
Trading Reference Links
|
Can one of you EL experts spend a minute to determine why the following
indicator code does not plot? The code is an attempt to calculate the offset
for the last intraday low that was also a daily pivot low (strength of 1).
i.e, if L[1] of daily bars was the pivot low and the actual intraday bar that
that low occurred was 100 bars ago, the plot would indicate 100. I have put
this code in an indicator because it is a block of system code that is not
working. I wanted to minimize any confusion with any helpers I may get with
this.
All values of the following code work properly except when the following block
of block of code is used:
{*****************************}
If Date <> Date[1] and
LoBar_3 > LoBar_2 and
LoBarYest > LoBar_2 then
begin
LoSwBar = LoBar_2;
end;
{*****************}
The line "LoBar_3 > LoBar_2" is what is preventing the indicator from
plotting. When you bracket it out you get a plot but it is wrong because that
code is required to get the correct value. When you plot the value of
LoBar_3 and LoBar_2 separately, it plots properly. Why the hell isn't there a
plot when "LoBar_3 > LoBar_2" is unbracketed?
Please respond to:
TWA7663@xxxxxxx
Thanks for your time!!!!!!!!
Russ
Here is the code:
{***********************************}
vars: LoLo(0),LoBar(0),LoOffSet(0),LoBar_3(0);
vars: LoBarYest(0),LoSwBar(0),LoBar_2(0);
{***** Calculation of a daily swing low (strength of 1) offset using intraday
bars only*********}
If Date <> Date[1] then
begin
LoLo = Low;
LoBar = Barnumber;
LoBarYest = LoBar[1];
end;
if Low < LoLo then
begin
LoLo = Low;
LoBar = barnumber;
end;
If Date <> Date[1] then
begin
LoBar_2 = LoBarYest[1];
LoBar_3 = LoBar_2[1];
end;
If Date <> Date[1] and
LoBar_3 > LoBar_2 and
LoBarYest > LoBar_2 then
begin
LoSwBar = LoBar_2;
end;
LoOffSet = Barnumber - LoSwBar;
If LoBar_3 > LoBar_2 and
LoBarYest > LoBar_2 then
begin
Plot1(LoOffSet,"LoOff");
end;
|