Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ADXVMA strategy problem?
Collapse
X
-
ADXVMA strategy problem?
I'm using ADXVMA Period 2 in a strategy. It plots fine when used only as indicator but as soon as I try to use in an strategy it plots differently. The red line is the normal ADXVMA period 2 plot and the blue line is the strategy one that is off for some reason. Any help would be much appreciated.Tags: None
-
Okay. thanks for the helpOriginally posted by NinjaTrader_Josh View PostPlease post the code. Both indicator and strategy.Attached Files
Comment
-
Ninja B,
This is the solution. You should not make variable assignments in the Initialize() method.
Cut these lines from the Initalize() method:
Move them to the OnBarUpdate() method:Code:WeightDX = ADXPeriod; WeightDM = ADXPeriod; WeightDI = ADXPeriod; ChandeEMA = ADXPeriod;
Code:if (CurrentBar == 0) { WeightDX = ADXPeriod; WeightDM = ADXPeriod; WeightDI = ADXPeriod; ChandeEMA = ADXPeriod; }Last edited by NinjaTrader_JoshP; 09-15-2008, 09:39 AM.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment