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,154 / 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

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


maxreturn View Post
Hello Fat Tails. As you know by now I use a 12 tick SBS Renko chart for longer term analysis and a 6 tick SBS Renko chart for timing the entry. One of the most useful indicators I've found for help in timing entry is the Swing Ray2 indicator (see attached) which does a terrific job of highlighting important price pivot support and resistance levels.

What I thought would be useful is to modify this indicator so that when setting up the indi on the 6 tick chart; both the rays from the 6 tick chart and 12 tick chart would print on the 6 tick chart. The lines derived from the 12 tick chart could be made thicker to indicate stronger support and resistance. Your thoughts?

Best Regards
Chuck

Several things come to my mind here:

(1) The SBS Renko bars are somewhat flawed. My multitimeframe indicators work with NinjaTrader default Renko bars and they also work with BetterRenko charts, but they cannot use SBS Renko.

(2) If you want to have the rays printed from a (genuine) 6 tick and a 12 tick chart, this is pretty easy. You do not need to code anything. If the ray strength is 5, just apply the indicator a second time with ray strength of 10. A ray strength of 10 on a 6-tick chart is equivalent to a ray strength of 5 on a 12-tick chart.

(3) The above logic holds true for minute, tick and volume charts, but not for range or Renko charts. If you want to display the rays of a 12-SBS-renko chart on a 6-SBS-Renko, you can use the square of the ray strength selected for the 12-SBS-Renko chart to derive it from the 6-SBS-Renko. This is not an exact but an approximative value.

Example: You wish to display rays with a trend strength of 5 derived from 12-SBS-Renko. So you would enter a ray strength of 5 * 5 = 25 into your 6-SBS-Renko indicator, and it should display what you look for.

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


davidfa View Post
Hello guys,
I am working on an indicator that would paint minute based bars on top of a range chart. Would also work for other combinations, but that is basically the need.
The idea is similar to @Fat Tails anaMultiPeriodCandles from where I got the plot logic.

The problem I am facing is to put the added second data series as a minute amount parameter as NT logic needs that value in the Initialize proc and it seems doesn't allow that as a parameter.

As I downloaded and had a glance to @gomi GomMultiTFIndicator, I realise that would be a nice workaround. Is there any indicator using this so as I can have it a as a sample implementation?

The code under development and image attached correspond to a version with fixed (no parameter) 5 minute bars as added dataseries.

Thanks for your work.
David

You could for example try to declare a variable thisPeriodValue and use it as shown below:

 
Code
#region Variables
        private int  thisPeriodValue = 5;
.......
#endregion
protected override void Initialize()
{
               Add(PeriodType.Minute, thisPeriodValue);
.......
}
Then add a property ThisPeriodValue to allow for values different from 5.

Reply With Quote
 
  #93 (permalink)
Elite Member
Rechovot
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: CQG
Favorite Futures: Index,Currency and Energy futures
 
perryg's Avatar
 
Posts: 1,703 since Jan 2010
Thanks: 504 given, 6,262 received

VisualSMAX3 for Linreg


Hello @Fat Tails,

Is it possible to have a version of the VisualSMA or VisualEMA as a LinReg version. So far I have been using both very successfully.

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


perryg View Post
Hello @Fat Tails,

Is it possible to have a version of the VisualSMA or VisualEMA as a LinReg version. So far I have been using both very successfully.

What do you call a LinReg Version? Do you mean a LinReg instead of a moving average?

Reply With Quote
 
  #95 (permalink)
Elite Member
Rechovot
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: CQG
Favorite Futures: Index,Currency and Energy futures
 
perryg's Avatar
 
Posts: 1,703 since Jan 2010
Thanks: 504 given, 6,262 received


Fat Tails View Post
What do you call a LinReg Version? Do you mean a LinReg instead of a moving average?

A LinReg Moving Average. At the moment we have an EMA and SMA moving average, and I would like to see also a LinReg moving average

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


perryg View Post
A LinReg Moving Average. At the moment we have an EMA and SMA moving average, and I would like to see also a LinReg moving average

I have not coded it so far. That said it can be done.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #97 (permalink)
Elite Member
Barcelona / Spain
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ZenFire
Favorite Futures: CL
 
davidfa's Avatar
 
Posts: 93 since Feb 2010
Thanks: 216 given, 118 received


Fat Tails View Post
You could for example try to declare a variable thisPeriodValue and use it as shown below:
.......
}[/CODE]Then add a property ThisPeriodValue to allow for values different from 5.

Ooops!
in a single test with that code had bad results and just asked too quickly before giving it another try.
Thank you @Fat Tails very much.

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

Plotting a 25 min MACD on a 5 min chart

I have looked for a way to code "false" multi-timeframe indicators from a single bar series. This has both advantages and inconvenients compared to real multi- timeframe indicators.

Advantage: Only loading 1 bar series, faster loading and calculation, robustness.

Inconvenient: The concept is limited to the same bar type, you cannot create range bars from minute bars, you only can create integer multiples of minute bars. The implementation uses artificial composite bars which are stocked in expandable ArrayList obejcts. These are the possible implementation.

(1) Replicating the higher timeframe indicator values. Below you will see the 25 min MACD calculated from a 5 min bar series. The Default mode reshapes the original NinjaTrader MACD as shown on a 25 minute chart. This requires repainting within the last unstable period of the composite bar. This makes the replication of the 25 min MACD less attractive for strategy applications.

(2) Raw mode shows the indicator values as calculated on a rolling basis without smoothing. The raw mode is useful, it the indicator values are accessed by another indicator or strategy, as it does not repaint.

(3) For use as a visual indicator with a slightly higher resolution than the original 25 min MACD, the raw values can be smoothed over the composite bar. This visual indicator does not repaint either, the smoothing introduces a small acceptable lag.

(4) The higher timeframe values can also be shown as a step function, which reflects the values as generated by the composite bars. The step function repaints 1 tick at the session end, as the session end is often charaterized by an odd period, which can not be predicted from the multplier used to generate the composite bars.

Chart attached for illustration: The concept can be applied to any indicator.

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

Reply With Quote
 
  #99 (permalink)
Elite Member
Quebec
 
Futures Experience: Intermediate
Platform: NinjaTrader wt Rancho Dinero's profiling tools
Broker/Data: Stage 5 trading/AMP/CQG
Favorite Futures: ES, NQ, YM
 
trendisyourfriend's Avatar
 
Posts: 3,697 since Oct 2009
Thanks: 3,041 given, 4,496 received

What is the difference between using a 5 x 5minutes and using a normal MACD with 12x5, 26x5, 9x5 periods ?

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



trendisyourfriend View Post
What is the difference between using a 5 x 5minutes and using a normal MACD with 12x5, 26x5, 9x5 periods ?

Your idea would work for a simple moving average. A 60-period SMA on a 1 min chart, would come quite close to a 12-period SMA on a 5 minute chart. Please see chart 1 below for comparison.

However, a 60-minute EMA on a 1 minute chart is already a little bit different from a 12-period EMA on a 5 minute chart, because of the recursive formula. See chart 2 below.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-chart-1.jpg   Coding Multi Time Frame (MTF) Indicators with NinjaTrader-chart-2.jpg  
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)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

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 02:25 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-12 in 0.15 seconds with 20 queries on phoenix via your IP 54.90.207.75