Inconsistent HighestBar returns with IntraBarOrderGeneration

Questions about MultiCharts and user contributed studies.
kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Inconsistent HighestBar returns with IntraBarOrderGeneration

Postby kernel » 10 Mar 2015

test script:

Code: Select all

[IntraBarOrderGeneration = TRUE]

vars:
BullBody(-1);

BullBody=C-O;

print("time:", time, "close:", close, " Highest(C-O,50):", Highest(C-O,50), " Highest(BullBody)", Highest(BullBody,50), " diff:", Highest(C-O,50)-Highest(BullBody,50));
print("time:", time, "close:", close, " Highestbar(C-O,50):", Highestbar(C-O,50), " Highestbar(BullBody)", Highestbar(BullBody,50), " diff==>", Highestbar(C-O,50)-Highestbar(BullBody,50));

RecalcLastBarAfter(1);
Output:

Code: Select all

time:2109.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2109.00close:3588.00 Highestbar(C-O,50): 2.00 Highestbar(BullBody) 2.00 diff==> 0.00
time:2109.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2109.00close:3588.00 Highestbar(C-O,50): 2.00 Highestbar(BullBody) 2.00 diff==> 0.00
time:2109.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2109.00close:3588.00 Highestbar(C-O,50): 2.00 Highestbar(BullBody) 2.00 diff==> 0.00
time:2110.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3585.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 3.00 diff==> 0.00
time:2110.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3588.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3588.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3587.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3587.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3588.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3588.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3586.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3586.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3585.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2110.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2110.00close:3585.00 Highestbar(C-O,50): 3.00 Highestbar(BullBody) 4.00 diff==> -1.00
time:2111.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3584.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3585.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3583.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3583.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3584.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3585.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3586.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2111.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2111.00close:3587.00 Highestbar(C-O,50): 4.00 Highestbar(BullBody) 4.00 diff==> 0.00
time:2112.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3585.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 5.00 diff==> 0.00
time:2112.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3585.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 6.00 diff==> -1.00
time:2112.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3585.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 6.00 diff==> -1.00
time:2112.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3584.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 6.00 diff==> -1.00
time:2112.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3585.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 6.00 diff==> -1.00
time:2112.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3586.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 6.00 diff==> -1.00
time:2112.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2112.00close:3585.00 Highestbar(C-O,50): 5.00 Highestbar(BullBody) 5.00 diff==> 0.00
time:2113.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3585.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3585.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3585.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3585.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3585.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3586.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2113.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2113.00close:3587.00 Highestbar(C-O,50): 6.00 Highestbar(BullBody) 6.00 diff==> 0.00
time:2114.00close:3582.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3582.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 7.00 diff==> 0.00
time:2114.00close:3587.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3587.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3586.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3584.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3586.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3586.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3585.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3584.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3582.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3582.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2114.00close:3581.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2114.00close:3581.00 Highestbar(C-O,50): 7.00 Highestbar(BullBody) 8.00 diff==> -1.00
time:2115.00close:3583.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3583.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 8.00 diff==> 0.00
time:2115.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3584.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3584.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3583.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3583.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3584.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3584.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3583.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3583.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
time:2115.00close:3585.00 Highest(C-O,50): 4.00 Highest(BullBody) 4.00 diff: 0.00
time:2115.00close:3585.00 Highestbar(C-O,50): 8.00 Highestbar(BullBody) 9.00 diff==> -1.00
Question:

With IntraBarOrderGeneration on, "Close" really means the next incoming tick, however, I don't see how this makes any difference with defining BullBody=C-O and quoting "C-O" directly. Further, why it makes difference with function HighestBar, but not Highest. Any one has clue? thanks.

User avatar
TJ
Posts: 7266
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 992 times
Been thanked: 2063 times

Re: Inconsistent HighestBar returns with IntraBarOrderGenera

Postby TJ » 10 Mar 2015

::
With IntraBarOrderGeneration on, "Close" really means the next incoming tick,
::
Where did you get this definition?

Can you give a link? or a screenshot of the text in question?

kernel
Posts: 91
Joined: 19 Feb 2013
Has thanked: 21 times
Been thanked: 4 times

Re: Inconsistent HighestBar returns with IntraBarOrderGenera

Postby kernel » 10 Mar 2015

Where did you get this definition?

Can you give a link?

This can be verified by the column "close" in the output.

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: Inconsistent HighestBar returns with IntraBarOrderGenera

Postby orion » 10 Mar 2015

The behavior of Highest() is correct and that of HighestBar() is controversial. I avoid using HighestBar(). The ExecOffset keyword is one of the worst features of EL/PL since it violates principles of good software engineering. It was added in EL without much thought and PL has had to support it for compatibility.


Return to “MultiCharts”