Coding Multi Time Frame (MTF) Indicators with NinjaTrader - NinjaTrader | futures io social day trading
futures io futures trading


Coding Multi Time Frame (MTF) Indicators with NinjaTrader
Updated: Views / Replies:103,488 / 411
Created: by Fat Tails Attachments:161

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
 161  
 
Thread Tools Search this Thread
 

Coding Multi Time Frame (MTF) Indicators with NinjaTrader

  #211 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


Zondor View Post
An approach that I have been using is to not tie the secondary series to a defined time, range, etc but instead to define it based on multiples of the primary data series. I believe this has been referred to as composite bars.

So, on any type of chart, the 2x "extended" time frame would simply look back twice as far as the base indicator, etc. This is not necessarily as simple as it seems. Sometimes when looking back twice as far you need to skip every other data point. Or when looking back three times as far, only look at one of every three of the previous data points. Otherwise all you are doing is doubling or tripling the lookback period in the base time frame. Except for indicators like the stochastic that are looking for highest highs and lowest lows.

I have coded a whole series of those indicators. Example below is the MACD. It is based on composite bars. I have not published it yet, because I still want to modify to take into account "rolling composite bars", for example if I have a 15 minute chart and a timeframe factor of 4, I could calculate the indicator values from the series of hourly bars shifted by 5 minutes, when the minute bars plots for 00:05.

Chart below shows the MACD calculated from composite bars, that is it displays the values for a 60 minute MACD on a 15 min chart.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-6e-12-11-15-min-28_10_2011.jpg  
Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:
 
  #212 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


Zondor View Post
So, on any type of chart, the 2x "extended" time frame would simply look back twice as far as the base indicator.

Not any type of chart. It will work on minute, tick and volume charts, as a 100 tick bar can be built from two 50 tick bars, but what about range bars? You cannot build an 8-range bar from two 4-range bars, because typically they overlap.

I have solved this issue by using the proportionality between range and the square root of time. You can effectively build an 8-range bar from
2 * 2 = 4 of those 4-range bars. The resulting indicators will run smoother than the original indicator that runs on an 8-range bar.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-fdax-12-11-2-range-_-fdax-12-11-4-range-28_10_2011.jpg  
Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:
 
  #213 (permalink)
Elite Member
New York, NY
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG
Favorite Futures: CL
 
wahn's Avatar
 
Posts: 101 since Sep 2010
Thanks: 1,800 given, 60 received

NewVisualSMA



Fat Tails View Post
I do not have 8 range no gap bars installed, so I can only run it on a range chart. I am now running it in real time against the old indicator and will post the result in a few minutes. I have also modified the test indicators to show whether they have detected historical data (blue dots) or real-time data (red dots). This makes it easier to find out what happens.

The modified indicator with the dots added and one additional minor change relating to the first real-time tick, when a minute bar series is loaded, is attached below:


Hi FT,

Thanks for providing better VisualMA!

How can I make dots(Blue or Red) smaller on larger bar width (8 or larger)?
Cheers,

Wahn

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-snagit-0006.png  

Last edited by wahn; October 30th, 2011 at 05:28 AM.
Reply With Quote
 
  #214 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


wahn View Post
Hi FT,

Thanks for providing better VisualMA!

How can I make dots(Blue or Red) smaller on larger bar width (8 or larger)?
Cheers,

Wahn

There will be no dots on the final version of the indicator, because the drawing all those dots is unnecessary and slows down NinjaTrader. Currently I just use the dots to mark the data as historical or real-time. Blue dots detect historical data, red dots real-time data.

Now I know that your chart uses historical data.

Reply With Quote
 
  #215 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


madLyfe View Post
what about this, is the new version supposed to follow the bar exactly like shown here(blue)? the old one is in black and kinda hanging back..

I have tested the NewVisual Indicators during the week end, and indeed in some cases the new indicator is not lagging any more. The last old version had compensated the lag, in case that the primary bars were identical with the secondary bar type loaded. The new version will also compensate the lag for different bar types, so there is indeed some improvement.

The chart below shows a range chart (primary bars, green and red) and secondary tick bars (control series in gray although not required by the indicator). The old indicator (orange) when calculating values from tick bars and plotting them to a range chart did indeed show a lag. while the new indicator (red) compensates for that lag.

The data box shows that the range bar and the tick bar have an identical time stamp at 14:38:05. The new indicator already uses the indicator value from that tick bar and displays it simultaneously for that range bar, while the old indicator lags one bar behind.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:
 
  #216 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary

Next Test Version for Visual Indicators

Here comes the next test version. There was a minor bug which affected the interpolation in visual mode directly after the session begin. On a non-equidistant chart the interpolation algorithm needs to substract the duration of the session break from the interpolation interval, which was omitted. It is now corrected.

I am very satisfied with the stability and performance of the new version. I just displayed an hourly 20-period EMA on a 1-minute chart with a lookback period of 365 days. These were the loading times:

old version of the indicator : 2 minutes and 10 seconds
new version of the indicator : 7 seconds

There is a significant performance gain, due to simplification. As shown in the post above the new version also produces a smaller lag than the old version. The indicator is slowly leaving its adolescence.

The latest test version of the indicator is attached below

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: zip VisualIndicatorsTest4.zip (45.9 KB, 63 views)

Last edited by Fat Tails; October 30th, 2011 at 06:28 PM.
Reply With Quote
The following 12 users say Thank You to Fat Tails for this post:
 
  #217 (permalink)
Elite Member
Rio de Janeiro
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire, IB
Favorite Futures: Equity & Futures
 
prisonbreaker82's Avatar
 
Posts: 312 since Jun 2010
Thanks: 57 given, 141 received

Hi Fat Tails,

I tested the indicator today and I got this message when using the indicator on a 5 minute chart.



Fat Tails View Post
Here comes the next test version. There was a minor bug which affected the
interpolation in visual mode directly after the session begin. On a non-equidistant chart the interpolation algorithm needs to substract the duration of the session break from the interpolation interval, which was omitted. It is now corrected.

I am very satisfied with the stability and performance of the new version. I just displayed an hourly 20-period EMA on a 1-minute chart with a lookback period of 365 days. These were the loading times:

old version of the indicator : 2 minutes and 10 seconds
new version of the indicator : 7 seconds

There is a significant performance gain, due to simplification. As shown in the post above the new version also produces a smaller lag than the old version. The indicator is slowly leaving its adolescence.

The latest test version of the indicator is attached below

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-untitled.png  
Reply With Quote
 
  #218 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


prisonbreaker82 View Post
Hi Fat Tails,

I tested the indicator today and I got this message when using the indicator on a 5 minute chart.

I suppose that you got that message, when you tried to save the template. I think that there is a NinjaTrader bug, which occasionaly hits and causes problems with the serialization. Best solution is to shutdown NinjaTrader and to restart it again.

If this does not help, please let me know what exactly you did to produce this message.

If anybody else has made the same observation, please let me also know.

Reply With Quote
 
  #219 (permalink)
Elite Member
Boston
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: Crude
 
PHXtrader's Avatar
 
Posts: 84 since Apr 2011
Thanks: 48 given, 76 received

Hey Fat Tails

I still heavily use your original version it does take a while to load but works like a charm once its up and running so a quicker load time got me interested in trying your new version. I imported the new one and it works great. I was just wondering if you could make it so you can select those dots on or off. I find they clutter up the screen a bit. Thanks for all the hard work on these indies!

Reply With Quote
 
  #220 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



PHXtrader View Post
Hey Fat Tails

I still heavily use your original version it does take a while to load but works like a charm once its up and running so a quicker load time got me interested in trying your new version. I imported the new one and it works great. I was just wondering if you could make it so you can select those dots on or off. I find they clutter up the screen a bit. Thanks for all the hard work on these indies!

The dots will disappear or be selectable in the final version. I have forced them now, because they tell me whether a chart that is posted uses historical or real-time data. The dots are just required for the testing process.

Reply With Quote

Reply



futures io > > > > Coding Multi Time Frame (MTF) Indicators with NinjaTrader

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
Multi Time Frame Strategy Cancellation jthom NinjaTrader Programming 2 October 9th, 2014 12:00 PM
Close bar recognization in multi time frame strategy pinto552 NinjaTrader Programming 6 September 6th, 2011 10:07 AM
Multi-time frame strategy with periods of different size pequemec NinjaTrader Programming 2 February 24th, 2010 01:41 PM
visual multi-time frame scoring system. benbrooke Traders Hideout 1 October 4th, 2009 06:49 PM
Multi Volume/Time Frame Trading wh The Elite Circle 7 September 15th, 2009 05:55 PM


All times are GMT -4. The time now is 09:06 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-18 in 0.17 seconds with 20 queries on phoenix via your IP 107.20.115.174