NexusFi: Find Your Edge


Home Menu

 





Historical Data and Marketreplay: Strategy not taking all trades


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kidvic with 2 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 sam028 with 1 posts (0 thanks)
    4. looks_4 ToMerK with 1 posts (1 thanks)
    1. trending_up 2,045 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

So I've been testing a strategy on market replay. I downloaded 20 days from the ninjatrader server, and as well downloaded the historical data for those same 20 days, (same instrument, same contract, same date/times). Then when I backtetsted that same strategy on the historical version, I got DIFFERENT results!
I checked the graphs, to make sure they lined up, and they did.
Then I went to look at the trades they took, and noticed that on the historical data some of the trades weren't being taken.
Mind you, this is the same strategy, with the same time-frame, same expiration, same dates, same chart.
What is going on? Can anyone enlighten me?
Has anyone come across something similar?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
No book, only a stair: journaling fills where price move …
Cryptocurrency
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Administrator
 
Posts: 3,767 since Jun 2009
Thanks Given: 3,836
Thanks Received: 4,691


It's impossible to answer without the strategy logic.
You may add some debugging instructions in your strategy to get some clues. Simple Print() should be enough (high was X, indicator Z at bar Y say this, etc).


Success requires no deodorant! (Sun Tzu)
Reply With Quote
  #4 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


sam028 View Post
It's impossible to answer without the strategy logic.
You may add some debugging instructions in your strategy to get some clues. Simple Print() should be enough (high was X, indicator Z at bar Y say this, etc).

It's the identical strategy. Why would it be different? Does it get interpreted differently?


Reply With Quote
  #5 (permalink)
 ToMerK 
Tel Aviv Israel
 
Experience: Beginner
Platform: NinjaTrader
Broker: CQG
Trading: Futures
Posts: 21 since Feb 2015
Thanks Given: 30
Thanks Received: 13


kidvic View Post
So I've been testing a strategy on market replay. I downloaded 20 days from the ninjatrader server, and as well downloaded the historical data for those same 20 days, (same instrument, same contract, same date/times). Then when I backtetsted that same strategy on the historical version, I got DIFFERENT results!
I checked the graphs, to make sure they lined up, and they did.
Then I went to look at the trades they took, and noticed that on the historical data some of the trades weren't being taken.
Mind you, this is the same strategy, with the same time-frame, same expiration, same dates, same chart.
What is going on? Can anyone enlighten me?
Has anyone come across something similar?

If you haven't read the following you should:
https://ninjatrader.com/support/helpGuides/nt7/?discrepancies_real_time_vs_bac.htm

When running a backtest you only use the end of the bar for OnBarUpdate calculations. In replay/real time if you use "CalculateOnBarClose = false" then each of the OnBarUpdate calculations takes place in each tick.

The fills are different as well as stated in the link above.

Other reasons are all given in the link.

Hope this answers your question...


Reply With Quote
Thanked by:




Last Updated on September 17, 2016


© 2026 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 - Downloads - Top
no new posts