Ninjatrader and backtesting - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Ninjatrader and backtesting
Started:December 13th, 2011 (04:11 AM) by ehlaban Views / Replies:1,697 / 3
Last Reply:December 15th, 2011 (10:24 AM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Ninjatrader and backtesting

Old December 13th, 2011, 04:11 AM   #1 (permalink)
Elite Member
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
Posts: 94 since Nov 2009
Thanks: 66 given, 56 received

Ninjatrader and backtesting

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.

Reply With Quote

Old December 13th, 2011, 04:11 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old December 13th, 2011, 11:32 AM   #3 (permalink)
Elite Member
Futures Experience: None
Platform: None Yet
Favorite Futures: Guitar
MrYou's Avatar
Posts: 402 since Jun 2011
Thanks: 611 given, 192 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:

Old December 15th, 2011, 10:24 AM   #4 (permalink)
Elite Member
London, UK
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
Adamus's Avatar
Posts: 1,083 since Dec 2010
Thanks: 467 given, 775 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.
Reply With Quote
The following user says Thank You to Adamus for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Ninjatrader and backtesting

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
VIDEO: MultiCharts vs. NinjaTrader strategy backtesting and optimization Big Mike MultiCharts 53 June 12th, 2016 01:34 PM
Ninjatrader vs. Metatrader for Backtesting and Realtime Analysis FX janson Platforms and Indicators 4 January 31st, 2012 11:32 AM
Backtesting Big Mike Terms (Glossary) 0 June 27th, 2010 05:42 AM
Help with backtesting nqemini Traders Hideout 5 January 16th, 2010 11:00 AM
Can NinjaTrader data be stored other than \My Documents\NinjaTrader 6.5 tc12357 NinjaTrader 4 December 15th, 2009 01:55 PM

All times are GMT -4. The time now is 06:41 PM.

Copyright © 2016 by 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

Page generated 2016-10-27 in 0.09 seconds with 19 queries on phoenix via your IP