Ninjatrader and backtesting - futures io
futures io futures trading

Ninjatrader and backtesting

Discussion in NinjaTrader

      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two MrYou with 1 posts (2 thanks)
    3. looks_3 ehlaban with 1 posts (0 thanks)
    4. looks_4 Adamus with 1 posts (1 thanks)
    1. trending_up 2,237 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Search this Thread

Ninjatrader and backtesting

(login for full post details)
  #1 (permalink)
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 92 since Nov 2009
Thanks: 66 given, 57 received

I'm in the process of starting with backtesting some ideas. As i'm evaluating
some programs for simple backtesting i now want to start with Ninjatrader.

I can remember by reading this forum that there are some issues with Ninja 7
with backtesting. I've read that results change and/or results are not always dependable.

Can somebody knowledgeble about Ninja say something if these issues are genuine
and do exist as perhaps i'm mistaken.

Now this is a honest question and i do not want to bash Ninja so if we can just discuss
if there are some things to watch out for or to handle in a special way.

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Neurological explanations for trading Success
Psychology and Money Management
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
Volume Profile Indicator for Ninja Script in NT8
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
137 thanks
Big Mike in Ecuador
34 thanks
Want your NinjaTrader indicator created, free?
32 thanks
Saturday Morning Market Replay!
20 thanks
Selling Options on Futures?
19 thanks
(login for full post details)
  #3 (permalink)
Experience: None
Platform: None Yet
Trading: Guitar
MrYou's Avatar
Posts: 403 since Jun 2011
Thanks: 618 given, 196 received

Someone correct me if I'm wrong, but the gist of it is...

The issue has to do with "intra-bar granularity". You can see the effect when your strategy only operates on the primary time period/frame (BarsInProgress = 0), but when you simply add a new time period your results change even though your strategy does not interact with this additional time period.

The workaround suggested by NinjaTrader is to make your entries on a higher time period such as a tick or minute chart. For example: EnterLongLimit(1, Close[0]); Which enters on the secondary time period within the strategy.

So what I do is compare the backtesting results of one day to the Market Replay results of the same day. If I get somewhat closer results then I'm a little more confident in the backtesting results as a whole. Next I will sim/paper trade the strategy with live data, which is where I am with my trading journey.

Here are some NinjaTrader Support provided links:

NinjaTrader Version 7
Strategy: Backtesting NinjaScript Strategies with an intrabar granularity - NinjaTrader Support Forum

I'm hopeful this will be fixed in the "next-gen" version of NinjaTrader.

Reply With Quote
The following 2 users say Thank You to MrYou for this post:
(login for full post details)
  #4 (permalink)
London, UK
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Adamus's Avatar
Posts: 1,085 since Dec 2010
Thanks: 471 given, 786 received

IMHO I find most people expect more than is reasonable from backtesting software. As in most things, it pays to keep things simple. I always make sure that I have very very few trades where the entry and the exit are on the same bar in the backtest results. If your software - NT7, TS, whatever - is hitting exits on the same bar as entries, I think you are asking too much of the software to cope with the situation in a way that reflects real life.

Personally I would programme my own backtesting software to be pessimistic and that if the bar hits both the target and the stop on the same bar, then it chooses the stop.

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Adamus for this post:

futures io Trading Community Platforms and Indicators NinjaTrader > Ninjatrader and backtesting

Last Updated on December 15, 2011

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Battlestations! Show us your trading desk - $1,500 in prizes!


Importance of Finding Your Own Way w/Adam Grimes

Elite only

Journal Challenge w/Jigsaw


Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts