Backtesting problems with Ninja - NinjaTrader | futures.io
futures.io futures trading
 

Go Back   futures.io

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


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

Welcome to futures.io.

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
     

Reply
 
Thread Tools Search this Thread

Backtesting problems with Ninja

Old April 5th, 2011, 06:50 AM   #1 (permalink)
Elite Member
Firenze, Italy
 
Futures Experience: Advanced
Platform: ninja
Favorite Futures: 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, 09:03 AM   #4 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,150 since May 2010
Thanks: 119 given, 1,703 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
 
Futures Experience: Advanced
Platform: ninja
Favorite Futures: currency futures
 
Posts: 4 since Mar 2011
Thanks: 0 given, 0 received

Futures Edge on FIO

How many trades per day do you place?

 
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
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: pfg
Favorite Futures: eminis
 
Posts: 322 since Jun 2009
Thanks: 6 given, 200 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
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 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
 
Futures Experience: Intermediate
Platform: ProRealTime
Favorite Futures: DAX
 
Posts: 38 since Jul 2015
Thanks: 6 given, 3 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
 
Futures Experience: Intermediate
Platform: ProRealTime
Favorite Futures: DAX
 
Posts: 38 since Jul 2015
Thanks: 6 given, 3 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
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 2,769 since Dec 2012
Thanks: 8,106 given, 5,274 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
     
The following user says Thank You to ratfink for this post:
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > Backtesting problems with Ninja

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

FIO Journal Contest with over $2000 in prizes [entire month]

September
 

Jigsaw Trading: Standalone Tools now available

Sep 26

Suri Duddella: The 10 Basic Trading concepts to follow in the Markets (part 2 of 2) [w/book giveaway]

Elite only

Linda Bradford Raschke: agenda TBA [w/book giveaway]

Elite only

Raymond Deux (NinjaTrader): NinjaTrader 8 overview and Q&A

Elite only

FuturesTrader71: agenda TBA (part 4 of 4) [w/book giveaway]

Elite only

Corey Rosenbloom: agenda TBA [w/book giveaway]

Elite only

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/FIO member shodson

Elite only

An Afternoon with FIO trader GFIs1

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Oct TBD
     

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 11:36 PM.

Copyright © 2016 by futures.io. 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-09-26 in 0.14 seconds with 38 queries on phoenix via your IP 54.160.198.60