Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > NinjaTrader


Backtesting problems with Ninja
Started:April 5th, 2011 (06:50 AM) by luitom Views / Replies:1,824 / 9
Last Reply:August 29th, 2015 (06:38 PM) Attachments:4

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, 770 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
Broker/Data: NinjaTrader Brokerage
Favorite Instrument: ES
 
NinjaTrader's Avatar
 
Posts: 1,020 since May 2010
Thanks: 90 given, 1,514 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: 322 since Jun 2009
Thanks: 6 given, 197 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
     

Old August 27th, 2015, 05:21 PM   #8 (permalink)
Elite Member
Stockholm
 
Trading Experience: Intermediate
Platform: ProRealTime
Favorite Instrument: DAX
 
Posts: 24 since Jul 2015
Thanks: 4 given, 2 received

I'm backtesting in Ninjatrader. And there is something seriously wrong on all strategies that involves stop och target. Every trade gets stopped out immadietely only one point above the entry price (FDAX). Even though both the stop och the target are 15-30 points away from the entry price.

This problem does not only occur using my own strategies, but also to the pre-built strategies in the software (e.g. "SampleMultiInstrument"). The same thing happens when I test the strategies on other futures/forex.

What is wrong and how to fix it?

Thanks in advance!


Last edited by Gabriel123; August 27th, 2015 at 05:30 PM.
Reply With Quote
     

Old August 29th, 2015, 04:34 PM   #9 (permalink)
Elite Member
Stockholm
 
Trading Experience: Intermediate
Platform: ProRealTime
Favorite Instrument: DAX
 
Posts: 24 since Jul 2015
Thanks: 4 given, 2 received

The same problem has happened to me several times now.

Suddenly every trade in my strategy gets stopped out immadietely only one point from the entry price. I am backtesting on FDAX and using 30 points stop loss (and 15 points profittarget).

This problem occured a couple of days ago, then suddenly it worked correct (meaning all the transactions ended 30 points at the stop or 15 points away at the limit) and then today this problem happened again. I have not changed anything relevant in the settings in the strategy during this period of time.

Please take a look at the attached images.

What is wrong?

Thanks in advance!

Attached Thumbnails
Backtesting problems with Ninja-sreenshot-01.jpg   Backtesting problems with Ninja-sreenshot-02.jpg   Backtesting problems with Ninja-sreenshot-03.jpg   Backtesting problems with Ninja-sreenshot-04.jpg  
Reply With Quote
     

Old August 29th, 2015, 06:38 PM   #10 (permalink)
Market Wizard
Birmingham UK
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Instrument: Dax
 
ratfink's Avatar
 
Posts: 2,216 since Dec 2012
Thanks: 5,299 given, 3,707 received
Forum Reputation: Legendary



Gabriel123 View Post
The same problem has happened to me several times now.

Suddenly every trade in my strategy gets stopped out immadietely only one point from the entry price. I am backtesting on FDAX and using 30 points stop loss (and 15 points profittarget).

This problem occured a couple of days ago, then suddenly it worked correct (meaning all the transactions ended 30 points at the stop or 15 points away at the limit) and then today this problem happened again. I have not changed anything relevant in the settings in the strategy during this period of time.

Please take a look at the attached images.

What is wrong?

Thanks in advance!

You've got bad data in there. You need to reload all your historical data, look at the exit prices you are being given and the lines on the chart.

Travel Well
Reply With Quote
     

Reply



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 01:56 AM.

Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2015 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 2015-09-01 in 0.08 seconds with 37 queries on phoenix via your IP 54.147.165.246