MTF Different Instruments Same time but handling missing bars - NinjaTrader | futures trading

Go Back

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

MTF Different Instruments Same time but handling missing bars
Started:March 19th, 2013 (08:03 AM) by leinster Views / Replies:350 / 0
Last Reply:March 19th, 2013 (08:03 AM) 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

MTF Different Instruments Same time but handling missing bars

Old March 19th, 2013, 08:03 AM   #1 (permalink)
Elite Member
Brussels / Dublin
Futures Experience: Intermediate
Platform: ninjatrader
Favorite Futures: Stdev + 2
Posts: 466 since Jun 2010
Thanks: 838 given, 589 received

MTF Different Instruments Same time but handling missing bars


Using Closes[1][0] && Closes[0][0] aswell as Times[0][0] && Times[1][0].

I have two instruments (which are similiar but on different markets).

Example: 1 = Euronext Milling Wheat Futures (Traded in europe) and 2 = Wheat (Traded on GLOBEX).

In this example i want to compare the price of european milling wheat versus wheat in the US. So i have put together an indicator to do this however i am facing a pretty common issue which im sure other's have seen.

Timeframe is 1 minute for both as i dont need to be blatantly high frequency.

But when i compare the bar's they do not always overlap on the right days / times reason being there are obviously holidays in states that are not in EU. My own PC runs eastern time so at least Times compares just eastern time.

I took a look at the correlation indicator on the forum and seen the following embedded into the onbarupdate and was thinking this might suffice if i take this code hack it and just wrap it at the start of my code and place a try whenever the timestamp's actually lineup. :

if( CurrentBars[0]<window || CurrentBars[1] < window ||(Closes[0].Count < window) || (Closes[1].Count < window) ) return;
double[] signalA = new double[window];
double[] signalB = new double[window];
int count = window;
for (int index = 0; index < count; index++)
if (null != Closes[0][index] && null != Closes[1][index]) {
double currentAClose = Closes[0][index];
signalA[index] = currentAClose;
double currentBClose = Closes[1][index];
signalB[index] = currentBClose;
} else {
Print("Corr - Missing bar, disregarding");

Is there a better way to do this that im not thinking of as id like the code to be as succinct as possible?

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > MTF Different Instruments Same time but handling missing bars

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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
Coding Multi Time Frame (MTF) Indicators with NinjaTrader Fat Tails NinjaTrader 411 June 28th, 2016 07:34 AM
Multiple Time Frames (MTF) in trading decisions? Big Mike Traders Hideout 6 March 15th, 2013 07:21 PM
Better Volume bars missing drw112 NinjaTrader 2 February 9th, 2012 01:55 PM
Download mutiple instruments for the same day at one time. LastShadowRider NinjaTrader 7 August 15th, 2011 08:04 PM
Using EasyLanguage to buy two instruments at the same time Big Mike EasyLanguage Programming 4 March 14th, 2010 09:23 AM

All times are GMT -4. The time now is 02:45 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-28 in 0.07 seconds with 19 queries on phoenix via your IP