vinetum replies to: TG Vorticity – By Lohad M1 Trading

Volvox, TudorGirl, Leledc-Fisher:
All those indicators have an inherited bug — they use future data to predict the past.

Variable bp is used in reverse manner — it is stored when b[i] (newer) was calculated to get past b[i+1] value because Metatrader 4 indicators arrays keep the most recent value in zero element (b[0]), and the oldest in b[n], where ‘n’ is oldest element index.

double d, d1, bp

for (i= 0; i<= limit; i++) { // calculate from bar zero to oldest one, i.e. from the future to the past

H= High[iHighest(NULL, 0, MODE_HIGH, HistLength, i)];
L= Low[iLowest(NULL, 0, MODE_LOW, HistLength, i)];

if (d+ 1.0 != 0.0 && 1- d!= 0.0)
b[i] = MathLog((d+ 1.0)/(1- d))/2.0 + bp/2.0;
b[i] = 0;

d1= d;
bp= b[i]; // keep b[i] buffer value (newer) to use that on next step to calculate b[i+1] (older)

Leave a Reply

Your email address will not be published. Required fields are marked *