Backtesting problems with Ninja - NinjaTrader | futures io social day trading
futures io futures trading


Backtesting problems with Ninja
Updated: Views / Replies:3,588 / 9
Created: by luitom Attachments:4

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Backtesting problems with Ninja

  #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
 
  #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.

 
  #3 (permalink)
Elite Member
Asia
 
Futures Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 785 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
 
  #4 (permalink)
Elite Member
Denver, CO
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES
 
NinjaTrader's Avatar
 
Posts: 1,230 since May 2010
Thanks: 150 given, 1,853 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
 
  #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

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
 
  #6 (permalink)
Elite Member
Israel
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: pfg
Favorite Futures: eminis
 
Posts: 322 since Jun 2009
Thanks: 6 given, 206 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
 
  #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
 
  #8 (permalink)
Elite Member
Stockholm
 
Futures Experience: Intermediate
Platform: ProRealTime
Favorite Futures: DAX
 
Posts: 39 since Jul 2015
Thanks: 6 given, 4 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
 
  #9 (permalink)
Elite Member
Stockholm
 
Futures Experience: Intermediate
Platform: ProRealTime
Favorite Futures: DAX
 
Posts: 39 since Jul 2015
Thanks: 6 given, 4 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
 
  #10 (permalink)
Market Wizard
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,235 since Dec 2012
Thanks: 10,770 given, 6,758 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 > > > > Backtesting problems with Ninja

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

July Journal Challenge w/$1100 in prizes from TopstepTrader

July
 

An Afternoon with FIO member Softsoap

Elite only

Battlestations: Show us your trading desks and win $750 in prizes

August
 

Extended Ask Me Anything w/Brett Steenbarger

Elite only

Prototyping Python Strategies (part 3) w/Ran Aroussi

Elite only

Brannigan Barrett w/Axia Futures

Elite only

Introduction to Phillip Capital futures brokerage services

Aug TBD

How Monte Carlo Analysis Can Help Your Trading w/Kevin Davey

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching Fin.Alg TPO Market profile from Ninja 6.5 to ninja 7 MadManmos Trading Reviews and Vendors 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 12:59 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@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 2017-07-24 in 0.16 seconds with 38 queries on phoenix via your IP 54.198.104.234