NexusFi: Find Your Edge


Home Menu

 





Ninjatrader and backtesting


Discussion in NinjaTrader

Updated
      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,839 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Ninjatrader and backtesting

  #1 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 91 since Nov 2009
Thanks Given: 66
Thanks Received: 57

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 NexusFi?
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Tao te Trade: way of the WLD
22 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #3 (permalink)
 
MrYou's Avatar
 MrYou 
NC, USA
 
Experience: None
Platform: None Yet
Trading: Guitar
Posts: 403 since Jun 2011
Thanks Given: 618
Thanks Received: 196


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: [AUTOLINK]Backtesting[/AUTOLINK] NinjaScript Strategies with an intrabar granularity - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

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

Reply With Quote
Thanked by:
  #4 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

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 NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on December 15, 2011


© 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