NexusFi: Find Your Edge


Home Menu

 





NinjaTrader strategy with wrong ADXVMA values


Discussion in NinjaTrader

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




 
Search this Thread

NinjaTrader strategy with wrong ADXVMA values

  #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 Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
70 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
20 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? - [AUTOLINK]NinjaTrader[/AUTOLINK] 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 Twitter Started this thread Reply With Quote
Thanked by:




Last Updated on August 16, 2009


© 2024 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 - Privacy Policy - Downloads - Top
no new posts