NexusFi: Find Your Edge


Home Menu

 





NinjaTrader strategy with wrong ADXVMA values


Discussion in NinjaTrader

Updated
    1. trending_up 5,252 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
GentleTrader's Avatar
 GentleTrader 
Rio de Janeiro - Brazil
 
Experience: Advanced
Platform: Sierra Chart
Broker: Stage5/IQFeed
Trading: ES
Posts: 85 since Jun 2009
Thanks Given: 7
Thanks Received: 47

Hi.

I'm getting wrong ADXVMA values in my strategies. For debugging, I plotted the current values using Print and saw that it was far from the correct values. I've put this in my strategy:

protected override void OnBarUpdate()
{

Print("ADXVMA: " + ADXVMA(21).ADXVMAPlot[0] + " Close: " + Close[0]);
Print("ADXVMA[1]: " + ADXVMA(21).ADXVMAPlot[1] + " Close[1]: " + Close[1]);
Print("===============");
}

The values printed are wrong when I see the correct values of it plotted in the chart.


Follow me on X Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
February NFP Preview -- Why This Mornings Jobs Number Co …
Traders Hideout
Kharg Island at 6%, Regime Fall at 1.5% -- The Black Swa …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #2 (permalink)
 
GentleTrader's Avatar
 GentleTrader 
Rio de Janeiro - Brazil
 
Experience: Advanced
Platform: Sierra Chart
Broker: Stage5/IQFeed
Trading: ES
Posts: 85 since Jun 2009
Thanks Given: 7
Thanks Received: 47

I just solved the problem. There is an issue in ADXVMA code that is discussed in ADXVMA strategy problem? - NinjaTrader Support Forum .

Cut these lines from the Initalize() method:
Code:
WeightDX = ADXPeriod;
WeightDM = ADXPeriod;
WeightDI = ADXPeriod;
ChandeEMA = ADXPeriod;
Move them to the OnBarUpdate() method:
Code:
if (CurrentBar == 0)
{
WeightDX = ADXPeriod;
WeightDM = ADXPeriod;
WeightDI = ADXPeriod;
ChandeEMA = ADXPeriod;
}


Follow me on X Started this thread Reply With Quote
Thanked by:




Last Updated on August 16, 2009


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts