Adding a wide range of contracts for backtesting - NinjaTrader | futures io social day trading
futures io futures trading


Adding a wide range of contracts for backtesting
Updated: Views / Replies:463 / 6
Created: by vhanded Attachments:0

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
 

Adding a wide range of contracts for backtesting

  #1 (permalink)
Elite Member
Kuala Lumpur Malaysia
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 8 since Nov 2014
Thanks: 3 given, 1 received

Adding a wide range of contracts for backtesting

Hi, I am currently backtesting calendar spread using NinjaTrader 7, and I am adding a list of CL contracts in Initialize(), like this:

 
Code
Add("CL 03-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-10", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-10", BarsPeriod.Id, BarsPeriod.Value);
			
			
			Add("CL 01-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 03-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-11", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-11", BarsPeriod.Id, BarsPeriod.Value);
			
			
			Add("CL 01-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 03-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-12", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-12", BarsPeriod.Id, BarsPeriod.Value);
			
			
			Add("CL 01-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 03-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-13", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-13", BarsPeriod.Id, BarsPeriod.Value);
			
			
			
			Add("CL 01-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 03-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-14", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-14", BarsPeriod.Id, BarsPeriod.Value);
			
			
			Add("CL 01-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 03-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 04-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 05-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 06-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 07-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 08-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 09-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 10-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 11-15", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 12-15", BarsPeriod.Id, BarsPeriod.Value);
			
			
			Add("CL 01-16", BarsPeriod.Id, BarsPeriod.Value);
			Add("CL 02-16", BarsPeriod.Id, BarsPeriod.Value);

And in my OnBarUpdate(), for demonstration purpose, I will just have:
 
Code
Print("Hello World");
The backtest period is from 1/1/2010 till 19/3/2015, using daily bar, and BarRequired = 0;


Th expected behavior is a list of "Hello World" in console output, but, I am not getting even 1. Seems like OnBarUpdate is not running at all.

However, remove CL 01-16 and CL 02-16 then "Hello World" will be printed. Why is this happening?

Reply With Quote
The following user says Thank You to vhanded for this post:
 
  #2 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,859 since Jun 2009
Thanks: 480 given, 3,255 received

Check the "Log" tab in the Control Center to see if there are any error messages, you may have some error messages that occurred in the Initialize() method.


vhanded View Post
Th expected behavior is a list of "Hello World" in console output, but, I am not getting even 1. Seems like OnBarUpdate is not running at all.

However, remove CL 01-16 and CL 02-16 then "Hello World" will be printed. Why is this happening?


Reply With Quote
 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


Can you actually chart 01-16 and 02-16? May be a data problem

Sent from my phone

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #4 (permalink)
Elite Member
Kuala Lumpur Malaysia
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 8 since Nov 2014
Thanks: 3 given, 1 received


Big Mike View Post
Can you actually chart 01-16 and 02-16? May be a data problem

Sent from my phone

Hi Big Mike, yes, I can add just CL 01-16 and CL 02-16, and "Hello World" is printing. No problem.

Reply With Quote
 
  #5 (permalink)
Elite Member
Kuala Lumpur Malaysia
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 8 since Nov 2014
Thanks: 3 given, 1 received


shodson View Post
Check the "Log" tab in the Control Center to see if there are any error messages, you may have some error messages that occurred in the Initialize() method.

Nothing is printing in Log...

Reply With Quote
 
  #6 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,859 since Jun 2009
Thanks: 480 given, 3,255 received


vhanded View Post
Hi Big Mike, yes, I can add just CL 01-16 and CL 02-16, and "Hello World" is printing. No problem.

Daily bars or intraday bars?

Reply With Quote
 
  #7 (permalink)
Elite Member
Kuala Lumpur Malaysia
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 8 since Nov 2014
Thanks: 3 given, 1 received


shodson View Post
Daily bars or intraday bars?

This is daily bar.

Reply With Quote

Reply



futures io > > > > Adding a wide range of contracts for backtesting

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wide spreads / Volatile stocks with mdsvtr Options on Futures 4 January 2nd, 2015 04:38 PM
Wide range body indicator saints51 NinjaTrader 2 August 7th, 2014 09:21 AM
Backtesting the 30min Opening Range Breakout Strategy. budfox Emini Index Futures Trading 4 October 27th, 2013 02:15 AM
Help adding a Pivot Range to following code: olobay MultiCharts 3 September 18th, 2012 10:07 AM
Backtesting range bars - problem? patbateman NinjaTrader 5 April 17th, 2012 12:19 AM


All times are GMT -4. The time now is 05:35 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-12-16 in 0.09 seconds with 19 queries on phoenix via your IP 54.160.245.121