• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:42pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:42pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MQL4 - FileWrite not working in strategy tester 2 replies

Strategy Tester - multi-timeframe moving averages not working 3 replies

2009.03.11 15:41:15Tester memory handler: tester stopped because not enough memory 19 replies

iADX scripting question 3 replies

ADX / iADX returning different doubles...? 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

iADX not working in Strategy Tester

  • Post #1
  • Quote
  • First Post: Feb 21, 2008 5:40pm Feb 21, 2008 5:40pm
  •  TraderGeek
  • | Joined Dec 2006 | Status: Member | 220 Posts
I have an EA that for some reason, the calculated value for the iADX indicator is always 0. It works fine in live / forward testing.

Here is the code:

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


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

Any ideas?
  • Post #2
  • Quote
  • Feb 21, 2008 5:46pm Feb 21, 2008 5:46pm
  •  smjones
  • Joined Mar 2006 | Status: THANK YOU MERLIN,TWEE and FF Team | 4,603 Posts
Quoting TraderGeek
Disliked
I have an EA that for some reason, the calculated value for the iADX indicator is always 0. It works fine in live / forward testing.

Here is the code:

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


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

Any ideas?
Ignored
Try

double ADX60 = iADX(NULL, 60,14,PRICE_CLOSE,MODE_MAIN,0);
 
 
  • Post #3
  • Quote
  • Feb 21, 2008 5:50pm Feb 21, 2008 5:50pm
  •  TraderGeek
  • | Joined Dec 2006 | Status: Member | 220 Posts
Quoting smjones
Disliked
Try

double ADX60 = iADX(NULL, 60,14,PRICE_CLOSE,MODE_MAIN,0);
Ignored
That did it. You think it was the Symbol()?
 
 
  • Post #4
  • Quote
  • Feb 21, 2008 5:52pm Feb 21, 2008 5:52pm
  •  smjones
  • Joined Mar 2006 | Status: THANK YOU MERLIN,TWEE and FF Team | 4,603 Posts
Quoting TraderGeek
Disliked
That did it. You think it was the Symbol()?
Ignored
No. It was the reference to an array within an array. iClose replace with PRICE_CLOSE
 
 
  • Post #5
  • Quote
  • Feb 22, 2008 4:16pm Feb 22, 2008 4:16pm
  •  snelsonibm
  • | Joined Mar 2007 | Status: member | 14 Posts
What code do you use to print the value to the journal as that would be helpful for my troubleshooting.

Thanks,

Scott
 
 
  • Post #6
  • Quote
  • Last Post: Feb 22, 2008 4:49pm Feb 22, 2008 4:49pm
  •  TraderGeek
  • | Joined Dec 2006 | Status: Member | 220 Posts
Quoting snelsonibm
Disliked
What code do you use to print the value to the journal as that would be helpful for my troubleshooting.

Thanks,

Scott
Ignored
I use the MQL Print() function.
 
 
  • Platform Tech
  • /
  • iADX not working in Strategy Tester
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022