NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 10-24-2011, 06:46 PM   #1
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default Historical data imported does not work

I have imported historical data between the period 2003 - June 2009 and tried to do walk forward optimization and back testing. While the testing appears to be running and my walk forward optimization ran for about 4 hours, it gave '0' transactions and hence no profit or loss.

I am running the strategy on range charts and therefore had uploaded tick data. I checked the data using the Historical Manager -> Edit mode and data appears to be there.

For example in ES 09-03 I have 'Last' data, but no 'Bid' and 'Ask' data. For range data I would presume 'last data' is adequate?

Any ideas why I am not getting any results?
sandeshrai is offline  
Reply With Quote
Old 10-24-2011, 06:51 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

Hello,

Yes, last data is all you need if that is what your strategy is running from.

Can you please try this using one of the default strategies such as the SampleMACrossovers and test to see if you do not get any results for the same period.

I look forward to assisting you further.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 10-25-2011, 12:20 AM   #3
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default

I tried running it on a couple of default strategies with the same result. It is not picking up any transactions
sandeshrai is offline  
Reply With Quote
Old 10-25-2011, 03:44 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

sandeshrai, can you please try with the automatic merge feature set to DoNotMerge for the ES master instrument under Tools > Instrument Manager. If you add continuous contract data to the system it would be to import it to the ES ##-## symbol (this is the continuous contract and not the individual one). Then create a regular range chart with your data and check if this is contructed ok, then apply the SampleMACrossOver here (if you dont have a connection, please simply use the External Feed to be able to apply a strategy to the chart in backtesting).

Thanks,
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 10-30-2011, 09:55 PM   #5
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default

I set the feature to 'Do Not Merge' and constructed a range chart. It chat is constructed fine. When I ran the 'SampleMACrossover" strategy it does show trades. When I back tested my strategy however, it does not show any trades.

My strategy does work on data for the current year (From Jan 1, 2011 to current date) which I did not upload.
sandeshrai is offline  
Reply With Quote
Old 10-31-2011, 07:25 AM   #6
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

Hello,

Have you ran TraceOrders on your strategy to help determine why these trades are not being taken? If not, please see the following link:

http://www.ninjatrader.com/support/f...ead.php?t=3627

The output from the TraceOrders property set to true should give us a better idea of why these trades might be ignored/not filled.
NinjaTrader_Matthew is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Matthew for this post:
Old 10-31-2011, 10:13 AM   #7
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default

The strategy does execute trades in the live environment data as well as in backtesting.

However, if you see my first note, I had uploaded historical data using the the Historical data manage. The strategy does not execute any trades on the uploaded historical data alone.

I did incorporate the 'TraceOrders = true;' command and ran backtesting. I am not sure where I can retrieve the output from?
sandeshrai is offline  
Reply With Quote
Old 10-31-2011, 10:17 AM   #8
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

Hello,

You should be able to see this by going to Tools--> Output window.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 10-31-2011, 11:07 AM   #9
sandeshrai
Member
 
Join Date: Jan 2010
Location: Irvine, CA
Posts: 58
Thanks: 12
Thanked 0 times in 0 posts
Default

I ran the trace on the old historical data and dont get any trace results. However, I am able to get a chart for the period. I tried this on the following periods:

1. 2/1/2006 - 2/28/2006
2. 2/1/2005 - 2/28/2005
3. 2/1/2006 - 4/21/2006

I ran the trace on current data (10/1/2011 - 10/31/2011) and I do get transactions as well as trace results.
sandeshrai is offline  
Reply With Quote
Old 10-31-2011, 02:43 PM   #10
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
Default

Hello,

If you do not see issues with the sample strategies, but have repeated issues on your strategy, you will need to debug your strategy. I would suggest simplifying the code as much as possible by commenting out segments you do not need for the basic functionality.

Click here for more information Debugging NinjaScript

Once you've checked that the strategy operates at a basic level (buys and sells during this period), you can readd the other conditions and statement to see if you can isolate the issue to a single line or group of code.
NinjaTrader_Matthew is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Matthew for this post:
Reply

Tags
backtesting, import historical data

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
Imported Historical TS Data Problem dincervolkan Charting 7 11-18-2010 11:01 AM
How to use imported historical data captnops Charting 1 02-09-2010 03:55 PM
can imported historical data be used for kaywai Indicator Development 1 01-27-2010 08:59 AM
How do I view imported historical data? KeelRisk Miscellaneous Support 1 12-26-2008 03:49 AM
Questions about imported Historical data maskiepop General Programming 3 08-27-2007 07:13 AM


All times are GMT -6. The time now is 11:37 AM.