NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 08-31-2008, 09:43 PM   #1
tradefaz
Senior Member
 
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
Default Just to confirm, there's no way to handle tick updates during historical backtest?

I'm doing a chart based strategy backtest using InteractiveBrokers historical data. Am I right that the only way to test the strategy and see how it handles both tick data and the bar update is to run it against the live feed (with a paper trading account)? Or is there a way to get it to handle tick updates on the backtest with historical data?
tradefaz is offline  
Reply With Quote
Old 08-31-2008, 10:02 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

That is correct. You can use the Market Replay feature for forward testing, but that requires you to record live market data for the instruments you wish to test.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-31-2008, 10:04 PM   #3
tradefaz
Senior Member
 
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
That is correct. You can use the Market Replay feature for forward testing, but that requires you to record live market data for the instruments you wish to test.
What's the best way to record multiple instruments? Is the only way to do this to open multiple charts and just let NT sit there recording?

Will NT support tick based backtesting in the next version?

Thx.
tradefaz is offline  
Reply With Quote
Old 08-31-2008, 11:08 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

You can use the Market Analyzer to load more instruments for recording.

Tick backtesting doesn't exist because there is no way to know how a 1min bar looks during that 1min. Even with tick data you are still missing bid/ask spread throughout that duration. This is why many people use forward testing on top of their backtesting.

For backtesting at the tick level you could try creating a multi-time framed strategy with a 1tick bar series.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-31-2008, 11:25 PM   #5
tradefaz
Senior Member
 
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
You can use the Market Analyzer to load more instruments for recording.

Tick backtesting doesn't exist because there is no way to know how a 1min bar looks during that 1min. Even with tick data you are still missing bid/ask spread throughout that duration. This is why many people use forward testing on top of their backtesting.

For backtesting at the tick level you could try creating a multi-time framed strategy with a 1tick bar series.
A multi-time framed strategy, I think I recall reading about that on here a week or so ago, that is probably what I'm looking for. I basically want to run the strategy on the bar update, but to check the price on every tick in the event that I meet my profit target before the current bar is finished. Many times the bar completes below the profit target, but there is no reason why I wouldn't take the profit earlier in the intra-bar period and just exit the position.

Also, doesn't a tick include the bid and the ask?
tradefaz is offline  
Reply With Quote
Old 08-31-2008, 11:48 PM   #6
tradefaz
Senior Member
 
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
You can use the Market Analyzer to load more instruments for recording.

Tick backtesting doesn't exist because there is no way to know how a 1min bar looks during that 1min. Even with tick data you are still missing bid/ask spread throughout that duration. This is why many people use forward testing on top of their backtesting.

For backtesting at the tick level you could try creating a multi-time framed strategy with a 1tick bar series.
I think I see what you mean about the tick, its either going to be a bid or an ask, not both, so when checking Close[0] on the 1 tick bar series, you have no way of knowing if its the bid or ask? But during a live test you could do a call to GetCurrentBid()/Ask()? Is that sort of what you meant?
tradefaz is offline  
Reply With Quote
Old 09-01-2008, 12:07 AM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Your understanding is correct.
NinjaTrader_Josh is offline  
Reply With Quote
Old 09-01-2008, 06:48 AM   #8
tradefaz
Senior Member
 
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Your understanding is correct.
I still don't quite get why if you are collecting tick data with OnMarketUpdate() you can't store whether its the bid or the ask and then provide that during historical replay? There are other tools out there that do tick based backtesting so what am I missing?

Also I tried a multi-time framed strategy and I didn't get that far.
tradefaz is offline  
Reply With Quote
Old 09-01-2008, 08:34 AM   #9
mrlogik
Certified NinjaScript Consultant
 
mrlogik's Avatar
 
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
Default

tradefaz,

OnMarketUpdate doesn't store bid / ask data, its just a method you can use to get that data real-time. In terms of backtesting, the best bet is to use the replay recorder. If you want to record data for multiple pairs without having a chart open for each, reference my post #14 @ http://www.ninjatrader-support.com/v...ead.php?t=9727

NT 7 will allow for historic volume, bid, ask references, as well as other things.

hope this helps.
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"

PureLogikTrading
mrlogik is offline  
Reply With Quote
Old 07-14-2009, 06:07 AM   #10
Gains
Member
 
Join Date: Mar 2007
Location: Minnesota,USA
Posts: 95
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by mrlogik View Post
...NT 7 will allow for historic volume, bid, ask references, as well as other things.
Will the External Data Feed Connection DLL Interface Functions have new functions to utilize these new data?
In other words will there be a new function VolumePlayback() added to the current bid, ask, last ...Playback() functions?

Thanks,
Gains
Gains is offline  
Reply With Quote
Old 07-14-2009, 06:47 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Gains, I'm not aware of changes to the External Feed data interface / DLL connection, but will check with development on this and update this thread then.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-14-2009, 07:12 AM   #12
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Gains, to follow up - this is already supported as the Bid / AskPlayback functions for the ATI support the 'size' parameter - http://www.ninjatrader-support.com/H...unctions2.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart not displaying tick data after historical tick data import Big D Miscellaneous Support 17 10-18-2010 03:14 AM
Please! Can we backtest strategies with tick by tick?? cassb Suggestions And Feedback 4 01-05-2009 02:54 AM
backtest tick by tick foxthorn Strategy Analyzer 1 05-18-2008 10:43 PM
Backtest on Tick, Chart on Minute shortorlong Strategy Analyzer 3 05-03-2008 04:02 PM
Backtest accuracy to the tick maxpi Suggestions And Feedback 2 08-05-2007 02:42 AM


All times are GMT -6. The time now is 03:02 AM.