I am trying to get the the current vlues of x period ADX using high and low price types. For this ppurpuse I have used a loop.
for int ( i = 100; i >= 0; i--)
{
double val1 = ADX(High, ADXbars)[i - 1];
double val2 = ADX(Low, ADXbars)[i - 1];
}
I have seen at output that val1 and val2 are identic. For each incrementation I obtain for given position "i" the same value for val1 and val2, But I am wondering why both values are identic.
In the documentation we have: double value = ADX(High, 20)[0]; meaning the current value of a 20 period ADX using high price type.
My val1 should be therefore the value at position [i -1] of ADXBars (int) period using high price type, while val2 represents the value at position [i -1] of ADXBars (int) period using Low price type.
What is wrong in my calculation so that val1 and val2 are identic?
Thanks!
Comment