PDA

View Full Version : iADX not working in Strategy Tester



pauvixxam
02-21-2008 15:40, 03:40 PM
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?

amshavin66
02-21-2008 15:52, 03:52 PM
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

amshavin66
11-10-2022 05:40, 05:40 AM
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-10-2022 07:02, 07:02 AM
Attempt

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

nalalaygammigo17
11-10-2022 09:47, 09:47 AM
What code would you use to publish the value into the journal as that could be helpful for my troubleshooting.

Thanks,

Scott

pauvixxam
11-10-2022 11:09, 11:09 AM
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.