Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > NinjaTrader


Notices
     

Backtesting problems with Ninja
Started:April 5th, 2011 (06:50 AM) by luitom Views / Replies:1,145 / 6
Last Reply:April 19th, 2011 (01:44 PM) Attachments:0

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

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

BMT is 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
     

Reply
 
Thread Tools Search this Thread

Backtesting problems with Ninja

Old April 5th, 2011, 06:50 AM   #1 (permalink)
Elite Member
Firenze, Italy
 
Trading Experience: Advanced
Platform: ninja
Favorite Instrument: currency futures
 
Posts: 4 since Mar 2011
Thanks: 0 given, 0 received

Backtesting problems with Ninja

I am trying to backtest a breakout strategy (which enters long or short on the high and low of a certain bar) with ninjatrader; I have minute and tick historical data. unfortunately, they both do not work. The minute historical executes trades on the following bar (not on the actual bar where the entry condition becomes true) therefore the entire strategy becomes useless. On the other hand tick historical does not seem to executes trades the right way and sometimes gaps appear which create unrealistic stop exits. Has anybody encountered my problems and found a way to solve them?

Reply With Quote
     

Old April 5th, 2011, 06:50 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 April 5th, 2011, 07:08 AM   #3 (permalink)
Elite Member
Asia
 
Trading Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 732 received

Answer
This post has been selected as an answer to the original posters question Answer


Have you looked at this?

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

Reply With Quote
     

Old April 5th, 2011, 09:03 AM   #4 (permalink)
Elite Member
Denver, CO
 
Trading Experience: Advanced
Platform: NinjaTrader
Favorite Instrument: ES
 
NinjaTrader's Avatar
 
Posts: 688 since May 2010
Thanks: 61 given, 882 received

Answer
This post has been selected as an answer to the original posters question Answer


luitom View Post
The minute historical executes trades on the following bar (not on the actual bar where the entry condition becomes true) therefore the entire strategy becomes useless.

This is expected and standard basic backtest concept. A bar is evaluated (which is its closing values), if a signal is then generated, an order is submitted which is then filled on the following bar.

Reply With Quote
     

Old April 5th, 2011, 02:07 PM   #5 (permalink)
Elite Member
Firenze, Italy
 
Trading Experience: Advanced
Platform: ninja
Favorite Instrument: currency futures
 
Posts: 4 since Mar 2011
Thanks: 0 given, 0 received

Many other backtesting platforms have the option of executing in the same bar. The fact that it executes on the following bar makes testing impossible for intraday strategies because all the entries and exits are modified!!! Is there any way to create 1 minute bar objects and then use one to check for the breakout condition and the other to execute the order on the same bar instead of the following one?

Reply With Quote
     

Old April 5th, 2011, 02:28 PM   #6 (permalink)
Elite Member
Israel
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: pfg
Favorite Instrument: eminis
 
Posts: 304 since Jun 2009
Thanks: 5 given, 163 received


Quoting 
Is there any way to create 1 minute bar objects and then use one to check for the breakout condition and the other to execute the order on the same bar instead of the following one?

I think you are making a conceptual error. NT executes the trades too early and not too late.
There is no such thing as bar close! If you trade on 1 min bars and you are on a 10:01 bar, when will it close?
When your PC clock strikes 10:01 or the exchange clock or the atomic clock strike 10:01? No, you will get the close only after you get the first tick (trade) for a new bar, and even if your clock shows 10:15!
So first you receive a tick for a new bar and then NT says OH! the previous tick was the last tick of 10:01 bar.
So NT opens a new bar and then and only then it can close the previous bar.
Only then the execution of the strategy is triggered, so your order goes to the broker after first tick of a new bar and if it is really really quick it will land at the exchange before other traders issued their orders.
OK I know that usually one tick (trade) shouldn't move the market, but obviously in real trading you can't issue your trade on the bar close!
I used eSignal before NT and there you were able to peek into the future (see the next bar) in backtesting, unfortunately I was not able to get the same feature in live trading.

Reply With Quote
     

Old April 19th, 2011, 01:44 PM   #7 (permalink)
Trading Apprentice
Munich
 
Trading Experience: Intermediate
Platform: NinjaTrader
Favorite Instrument: Anything with Volume
 
Posts: 7 since Mar 2011
Thanks: 0 given, 3 received

In my experience is isn´t really possible to adequatly emulate real world live order execution as there are simply to many things to consider.
If you´re doing you´re backtesting just look at how execution dependant your strategy is by substracting a decent amount of slippage from each trade or try a slightly delayed execution algo.

Reply With Quote
     

Reply



Tags
ai, algo, automated, backtest, backtesting, bars, basic, breakout, broker, brokers, close, condition, create, data, entry, error, es, esignal, exchange, execution, filled, future, gaps, high, historical, historical data, intraday, live, live trading, low, market, ninja, ninjascript, ninjatrader, nt, option, order, orders, platforms, signal, slippage, stop, strategies, strategy, support, tick, trade, traders, trades, trading, values
     

Big Mike's Trading Forum > Trading Forums > Platforms and Indicators > NinjaTrader > Backtesting problems with Ninja

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching Fin.Alg TPO Market profile from Ninja 6.5 to ninja 7 MadManmos Vendors and Product Reviews 19 August 23rd, 2011 08:15 AM
Range Bar Problems togier NinjaTrader 7 November 16th, 2010 11:24 AM
Problems with Ninja and IB spinnybobo NinjaTrader 6 June 20th, 2010 07:52 PM
What are the problems with backtesting? jeffbg123 Traders Hideout 4 March 5th, 2010 05:08 PM
PrintWithTimeStamp problems... MXASJ NinjaTrader Programming 3 February 13th, 2010 09:17 AM


All times are GMT -4. The time now is 09:26 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. 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 2014-04-20 in 0.19 seconds with 31 queries on phoenix via your IP 54.205.166.220