NexusFi: Find Your Edge


Home Menu

 





NinjaTrader strategy with wrong ADXVMA values


Discussion in NinjaTrader

Updated
    1. trending_up 4,624 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
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
Funded Trader platforms
16 thanks
ApexTraderFunding.com experience and review
13 thanks
Trading with Intuition
12 thanks
GFIs1 1 DAX trade per day journal
9 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