Real-time/Market replay auto contract rollover strategy - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Real-time/Market replay auto contract rollover strategy
Started:October 29th, 2014 (04:05 PM) by grankus Views / Replies:668 / 1
Last Reply:October 29th, 2014 (04:05 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Real-time/Market replay auto contract rollover strategy

Old October 29th, 2014, 04:05 PM   #1 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader 7
Favorite Futures: CL, TF
grankus's Avatar
Posts: 8 since Aug 2012
Thanks: 5 given, 0 received

Real-time/Market replay auto contract rollover strategy


I just checked all Big Mike’s posts but I didn’t find anything that solved this issue, I think. Maybe because it’s a stupid question and it’s something so basic you can do easily with Ninjatrader 7 vanilla options.

The question is… anyone knows if there is a way to switch/rollover from one contract to the next one, based on its DailyVolume or its expiration date in a strategy, running on real-time or market replay?

I was wondering how I would do it:

1• I think that maybe could be possible getting the maximum DailyVolume of a contract list/array, that could be filled with a loop or using the Market Analyzer list… I’m not sure if this is possible or not.

2• The other way that I thought was using the expiration day of every contract as a trigger to change to the next contract, just retrieving the “Contract month” and the “Rollover date” in the Instrument Manager/Editor.

I programmed something “similar” with vba in the past in order to generate a continuous contract with the market replay data, comparing the same instrument “.ntm/.nt2” files in a day/folder and “getting rid” of the lighter ones, finally renaming the months. Example: “02-12”… to “##-##”.
I did it with an expiration date list either but that was a bit tricky and slower than the first option.
The point of this is that I think this project could not be so difficult because I’m not a programmer and I managed to create a Marker Replay Data manager based on the same principles.

Once I know which contract is the one with the higher DailyVolume, I would like to change to it automatically while the strategy is running. Ex: “CL 02-12” to “CL 03-12”. But again I don’t know how to do it

So far I change contracts manually using the Market Analyzer with a DailyVolume column that it’s linked to a chart which is running a strategy, but this method it’s a bit limited, especially if I have several strategies running at the same time.

Thank you very much!


PS: Sorry for the grammar I do my best!

Reply With Quote

Old October 29th, 2014, 04:05 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Real-time/Market replay auto contract rollover strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order fills on real time vs market replay calhawk01 NinjaTrader 4 November 16th, 2013 02:22 AM
NinjaTrader - Market Replay - Rollover / Volume Rollover drunkcolonel NinjaTrader 0 October 22nd, 2012 06:23 PM
Contract Rollover: Adopt Real World Position and manage per previous position entry RM99 EasyLanguage Programming 3 May 30th, 2012 06:55 AM
Handeling contract rollover with Auto Strategy ? marker Elite Automated NinjaTrader Trading 2 December 13th, 2011 02:03 PM

All times are GMT -4. The time now is 06:42 AM.

Copyright © 2016 by 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 2016-10-24 in 0.11 seconds with 20 queries on phoenix via your IP