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

  #241 (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

Thanks
Do I have to add the DLL file as well or just the cs file?

Reply With Quote
 
  #242 (permalink)
Elite Member
Des Moines, Iowa
 
Futures Experience: None
Platform: Ninja, TOS
Broker/Data: AMP/CQG, TOS
Favorite Futures: CL, TF, GC
 
madLyfe's Avatar
 
Posts: 1,641 since Feb 2011
Thanks: 9,217 given, 1,011 received


PHXtrader View Post
Thanks
Do I have to add the DLL file as well or just the cs file?

use the zip files.. uninstall the asseblies from utilities -> remove ninjascript assemblies, then restart ninja, then install the new indies zip files like you would any other new indicator..

dont believe anything you hear and only half of what you see

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Reply With Quote
The following user says Thank You to madLyfe for this post:
 
  #243 (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


Thanks

I usually download these to my mac first to avoid contaminating my trading computer and then transfer to my trading computer but for some reason my mac was automatically extracting the zip file so I just downloaded it direct to my trading computer from futures.io (formerly BMT) and it worked like a charm.

Thanks Again.

Reply With Quote
 
  #244 (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


PHXtrader View Post
Fat Tails thanks for the hard work. Trying to remove the old one and install the new one but running into some problems. Do I just use the Remove Ninja script in utiities to deleate the old one? And then to install then new one drag the cs file into the indicator folder and f5 to compile? when I downloaded it it didn't come through as a file that can be imported.

Thanks for the help.
(used to be proficient at adding new NJ scripts but haven't changed my setup in so long I think I forgot how)

@PHXtrader: Do not drag and drop any files into any folders!

Here is the correct way to do it:

(1) Remove old assembly via File -> Utilities -> Remove NinjaScript Assembly
(2) Shut NinjaTrader down and restart it.
(3) Install new file via File -> Utilities -> Import NinjaScript.

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #245 (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

Difference between Strategy and 1-Tick-Correction Mode

Here is a question from @trendisyourfriend, who has observed a specific behaviour of the VisualSMA and VisualEMA in strategy mode. Here is my answer


Strategy Mode : No lag and additional tick versus 1-bar lag and no transition tick


The indicators are designed to reduce lag on both historical and real-time data. Historical bars are "one-tick" bars, so the first tick always closes the bar. The strategy mode is optimized to be used on historical data - this includes backtesting -, so it will always close the bar with each historical tick. There is price to pay for being able to do so!

When transiting from historical to real-time data, NinjaTrader inserts an artificial last historical tick. This tick triggers the calculation of the indicator value, as the indicator does not know yet that this is last false historical tick. For that reaseon you will find one (false) additional value inserted during that (60-minute-) bar of the secondary bar series which covers the transition. This is what you observed.

After the transition, the strategy mode will collect information from the secondary (60-minute-) bar series and write it to the primary bar series, with a small lag of one tick. In the chart this translates to a lag of one bar. This is becuase the FirstTickOfBar event is needed to close the bar and to write the indicator value to the primary series.

By the way this way a design choice that I made for the strategy mode. It would have been possible to design the indicator in a way that it produces a 1 bar lag on historical data. In this case there would be no additional value inserted during the transition period.

So you either you get

-> no lag on historical data, but 1 transition bar
-> a one-bar lag on all historical data and no transition bar

The xcMovAvg for example lags 1 bar over the complete historical data. If used for backtesting this is not really the optimum.


Use One-Tick-Correction Mode


For your aplpication, you can use the 1-Tick-Repaint mode. It typically corrects that additional historical tick and weeds it out. Your chart should then display as you expect it.

Please see below tow charts, one in strategy mode with the inserted value and the 1-bar lag, and one in One-Tick-Repaint mode, which has all corrected. I have put the VisualEMA on the One-Tick-Repaint chart to show that it does not affect the collection of VisualSMAs.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-6e-12-11-1-min-10_11_2011-strategy.jpg   Coding Multi Time Frame (MTF) Indicators with NinjaTrader-6e-12-11-1-min-10_11_2011-one-tick-correction.jpg  
Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #246 (permalink)
tw
Singapore
 
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: EUR/USD CL TF
 
Posts: 73 since Sep 2011
Thanks: 80 given, 12 received


Fat Tails View Post
After extensive and successful tests, I have now replaced the VisualSMA and VisualEMA in the download section with the new versions.

The indicators can be found here.

https://futures.io/download/ninjatrader-7/indicators/939-download.html?view
https://futures.io/download/ninjatrader-7/indicators/942-download.html?view

The new indicators should load a lot fast than the old ones and also use less resources in real-time. Under specific conditions the lag will be reduced as well.

There is also an added option to display the nodes, that is the first bars of the primary series after a bar of the secondary series has been completed. The nodes accomodate the indicator values calculated from the secondary bars. The distance between the nodes is interpolated.

The chart below shows an hourly EMA(20) and an hourly SMA(20) displayed on a 5-min chart.

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

@Fat Tails,
Just like to thank you and to inform you that my problems are shorted out.
Good Trading,
TW

Reply With Quote
The following 2 users say Thank You to TradeWind for this post:
 
  #247 (permalink)
Elite Member
Newcastle Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E
 
Rocketdog's Avatar
 
Posts: 60 since Jun 2011
Thanks: 98 given, 62 received

From Perry's Thread

Hi Fat Tails,

I'm using live data. Here is a screen shot.


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 user says Thank You to Rocketdog for this post:
 
  #248 (permalink)
Elite Member
Newcastle Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E
 
Rocketdog's Avatar
 
Posts: 60 since Jun 2011
Thanks: 98 given, 62 received

From Above

Webinar Basic2 - Perry.xml

Reply With Quote
 
  #249 (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


Rocketdog View Post
Hi Fat Tails,

I'm using live data. Here is a screen shot.


Attachment 55106

This chart has all information eliminated.

Which of the lines is the VisualSMA, what are the settings, and what are the differences between the old and the new indicator?

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #250 (permalink)
Elite Member
Newcastle Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: 6E
 
Rocketdog's Avatar
 
Posts: 60 since Jun 2011
Thanks: 98 given, 62 received



Fat Tails View Post
This chart has all information eliminated.

Which of the lines is the VisualSMA, what are the settings, and what are the differences between the old and the new indicator?

The Visual SMA's are in panel two, cyan and red dashed lines. The new Visual SMA MTF didn't plot as smoothly.




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 user says Thank You to Rocketdog for this post:

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 11:03 PM.

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-11 in 0.14 seconds with 20 queries on phoenix via your IP 54.145.16.43