PDA

View Full Version : iADX not working in Strategy Tester



amshavin66
11-13-2022 02:23,
I've an EA that for some reason, the calculated value to the iADX indior is always 0. It works good in live.

This is the code:

//Get ADX
double ADX60 = iADX(Symbol(),PERIOD_H1,14,iClose(Symbol(),PERIOD_ H1,0),MODE_MAIN,0);


I've verified it is not working by printing it into the journal. It is always 0.

Any thoughts? Attempt

double ADX60 = iADX(NULL, 60,14,PRICE_CLOSE,MODE_MAIN,0);

pauvixxam
11-13-2022 02:33,
Attempt

dual ADX60 = iADX(NULL, 60,14,PRICE_CLOSE,MODE_MAIN,0); That did it. You think it was that the Symbol()? )

amshavin66
11-13-2022 02:45,
That did it. You think that it was the Symbol()? No. It was the reference to an array within an array. IClose replace with PRICE_CLOSE

nalalaygammigo17
11-13-2022 02:53,
What code would you use to publish the value into the journal as that could be helpful for my troubleshooting.

Thanks,

Scott

pauvixxam
11-13-2022 03:00,
What code do you use to publish the value into the diary as that would be helpful for my troubleshooting.

Thanks,

Scott I use the MQL Print() function.

pauvixxam
11-13-2022 03:22,
I have an EA that for some reason, the calculated value to the iADX indior is always 0. It works fine in live.

Here is the code:

//Get ADX
dual ADX60 = iADX(Symbol(),PERIOD_H1,14,iClose(Symbol(),PERIOD_ H1,0),MODE_MAIN,0);


I have confirmed it is not functioning by printing it to the journal. It is always 0.

Any thoughts?