NexusFi: Find Your Edge


Home Menu

 





Project: Building a Calendar Spread BAR TYPE


Discussion in NinjaTrader

Updated
    1. trending_up 1,918 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 6 posts
    2. attach_file 2 attachments




 
Search this Thread

Project: Building a Calendar Spread BAR TYPE

  #1 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

Hey futures.io (formerly BMT),

I have a impossible goal! I would like to build a Calendar Spread Bar Type.

The concept is simple, take one price from a contract and subtract it from another. i.e. NG 03-15 minus NG 04-15 (the widow maker spread).

But what I do not want to do is build it as a indicator. Why, well those who know me, knows that I like Point and Figure charts which does not have time. I can not build a PnF based indicator because the Bars in progress will not match the PnF style of the spread.

How to get around this? Build my own Bar Type!

Any thoughts on where to start?

As I work on this project I will post my progress here.. Maybe if I can get some smarter people than myself working on this we can come up with a solution; but, maybe there is no solution in NT7.

Sody

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,602

If you accomplish this, I would suggest it is useful for more than just calendar spreads, but also synthetic spreads of any nature. BTW, Sierra Chart has this built-in, which means the source code is probably available in C++ in the source folder of SC.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085



Big Mike View Post
If you accomplish this, I would suggest it is useful for more than just calendar spreads, but also synthetic spreads of any nature. BTW, Sierra Chart has this built-in, which means the source code is probably available in C++ in the source folder of SC.

Mike

Thanks Mike,

I don't have SC, if someone has the source files can you upload them here?

And yes once I figure out the calendar spread I think it would be wise to add functionality for other spreads.

Cheers,

Sody

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

I am going to start by trying to add a new masterinstrument to an existing custom bartype.

I choose SveRenko because of the simplicity of the code. you can download the code here:



This will be the starting point!

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

Also, I will be building this code in Visual Studio 2012.

It will be important to add intellisense to the project so we can easily build out the code; you can do this here:



When done correctly, you should have your VS looking like the attached image.

Cheers,

Sody

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Attached Thumbnails
Click image for larger version

Name:	VS2012.png
Views:	175
Size:	131.2 KB
ID:	177153  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 
SodyTexas's Avatar
 SodyTexas 
Austin TX
 
Experience: Advanced
Platform: Ninjatrader, Python, & R
Broker: RJO
Trading: Futures, Spreads
Posts: 421 since Sep 2013
Thanks Given: 117
Thanks Received: 1,085

You can see that the AddBar function is looking for double values.. See image attached.

What I need to do is find a way to call multiple instruments into the code. Any ideas?

"The great Traders have always been humbled by the market early on in their careers creating a deep respect for the market. Until one has this respect indelibly engraved in their makeup, the concept of money management and discipline will never be treated seriously."
Attached Thumbnails
Click image for larger version

Name:	VS2.png
Views:	207
Size:	135.4 KB
ID:	177161  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 
fesx's Avatar
 fesx 
Georgia
 
Experience: Intermediate
Platform: Ninja
Broker: AMP/CQG
Trading: ZN, ES, FGBL, FESX
Posts: 133 since Jul 2009
Thanks Given: 874
Thanks Received: 113

@SodyTexas, How is the spread bar type coming along? I have always been interested in spread charts.

Reply With Quote




Last Updated on August 26, 2016


© 2024 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 - Privacy Policy - Downloads - Top
no new posts