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

  #171 (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,601 received
Forum Reputation: Legendary


Braulio View Post
I think I may have found something else...

This morning Ninja kept giving me the following error message :

09-09-2011 07:29:34 Default Connection to NinjaTrader historical market data server lost: The process cannot access the file 'C:\Users\BP\Documents\NinjaTrader 7\db\tick\6E 09-11\201109090800.Last.ntd' because it is being used by another process.

I logged on and off, restarted Ninja and it the error message kept popping up everytime I tried to connect but then I noticed something : all the windows (I have 13 chart windows open) were being updated with data (I can see the candles and all the indicators, etc) EXCEPT the charts that have VisualSMA's...they were blank. Because that got me a little suspicious, I decided to close all the charts that have VisualSMA's and restart Ninja. Now the error message is gone.
After a successful connection, I re-opened my charts with VisualSMA's and everything seems fine.

Might there be an issue with the VisualSMA's accessing tick data on these files?

The VisualSMA has a second bar series added, and that bar series will be generated from historical tick data, when the chart is opened. What possibly happened in your case is that you opened several charts - a workspace - at once, and that several of your charts tried to access the same historical data files in parallel.

This problem is linked to the internal design of NinjaTrader, in particular the synchronization of data loading for different bar series and charts. The indicator design has no impact on this. However, synchronization issues depend on the amount of data loaded. The more charts you have open, the larger the lookback periods that you have selected, the more likely it is that you will run into problems. Minute data is less likely to produce this behaviour.

NinjaTrader can do a lot of things, but it invites you to process huge amounts of data, and some of the processes can easily get stuck. The VisualSMA still has a weakness, which I need to address. If you have large holes in your historical tick or minute data (one of them, not both), then the interpolation algorithm may try to calculate over a period of weeks or months, which may kill your machine in terms of memory and CPU requirements. But this is a rare event, as it only occurs, when you try to load the indicator, without having checked your historical data.

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
  #172 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received


Braulio View Post
I think I may have found something else...

This morning Ninja kept giving me the following error message :

09-09-2011 07:29:34 Default Connection to NinjaTrader historical market data server lost: The process cannot access the file 'C:\Users\BP\Documents\NinjaTrader 7\db\tick\6E 09-11\201109090800.Last.ntd' because it is being used by another process.

No clue about VisualSMA.

But, I have seen similar problems with NinjaTrader with some anti-virus programs. I had problems with Trend Micro if I recall, and Kaspersky. In the end, I would recommend getting rid of all anti-virus programs and just use Microsoft Security Essentials, if you know better than to download viruses from the internet and emails

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #173 (permalink)
Elite Member
San Mateo, CA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 42 since Aug 2010
Thanks: 194 given, 24 received

Re: Installation error with VisualSMA (update version Sep 6,2011)


Hello,

Below was a PM between me and Fat Tails about installation error with VisualSMA. With Fat Tails' permission, I am posting here, for anyone might get the similar problem.

Key points:
1. NT7 utilities is the way to remove the assembly.
2. I was so dumb that I did not know that and only struggled with Windows to do the work.
Big thanks to Fat Tails. It works great for me.
Peter


====================================
Quoting ilikeread

Dear Fat Tails,

I would express my deep appreciation to you for your great efforts in writing countless indicator for the forum.

I have a question regarding the VisualSMA installation (the newest update version on Sep 6, and my previous version is the version of Aug 30 https://futures.io/free_downloads/ninjatrader-7/indicators/939-download.html)

My problem in installation is similar to the post from pedrobraz in Perry’s thread (https://futures.io/elite-circle/13189-perrys-trad...mbers-35.html#post151521 (post #346). I followed your instruction to remove the SMA Assembly.

My understanding of the Assembly is the following four files in the Documents\NinjaTrader7\bin\Custom folder:
VisualSMAMTF.X64(DLL File)
VisualSMAMTF.X86( DLL File)
VisualSMAMTF (DLL File)
VisualSMAMTF (CS File)

With the Assembly in the folder, I did the import. Then NT7 shows: “Import failed. The NinjaScript Archive File may contain duplicate method names that already exist on your PC or there is a required file missing on either your PC or in the import archive”

Once I remove the Assembly in the folder, I did the import. Then NT7 shows. “ You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive File.”

I also tried to do a compilation once I removed the Assembly, an error message shows: “Documents\NinjaTrader7\bin\Custom\VisualSMAMTF.DLL could not be found.” After I put the Assembly (the four files) back and did the compilation, the error message is gone.

It thus seems I have no way to correctly remove the assembly and import the new VisualSMA file.

May I get your kind help with this issue? Thank you very much! By the way, if this is useful for other forum users, I can post it as a public message. Please let me know and I can do as you suggested.


Best wishes

Peter (ilikeread)

===========================================
Quoting Fat Tails

I do not mind, if you post publicly. Some recommendations:

(1) First remove old assembly via File -> Utilities -> Remove NinjaScript Assembly

(2) Then install new assembly via File -> Utilities -> Import NinjaScript Assembly

(3) If you get the the message "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive File.” , this is not necessarily linked to the VisualSMA file. Could you please have a look at your logs (Control Center) or your log file (My Documents -> NinjaTrader 7 -> log -> file with today's date)

Harry


Last edited by ilikeread; September 13th, 2011 at 10:37 PM.
Reply With Quote
The following user says Thank You to ilikeread for this post:
 
  #174 (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

ADX Multi Time Frame

Hello @Fat Tails,
Is there a chance that you can throw together a MTF for the ADX as per the attached chart. I used JeffsADX using color change when up and down.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-adx-multiframe.png  
Reply With Quote
 
  #175 (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,601 received
Forum Reputation: Legendary


perryg View Post
Hello @Fat Tails,
Is there a chance that you can throw together a MTF for the ADX as per the attached chart. I used JeffsADX using color change when up and down.

I have something, which is work in progress, but not yet ready for publishing. You can test it, but I do not want to distribute it now to the public.


Last edited by Fat Tails; September 23rd, 2011 at 11:00 AM.
Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #176 (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
I have something, which is work in progress, but not yet ready for publishing, You can test it, but I do not want to distribute it now to the public.

Can you send it to me via a PM and I will test it. Of course only you can publish for distribution.

Reply With Quote
 
  #177 (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,601 received
Forum Reputation: Legendary


perryg View Post
Can you send it to me via a PM and I will test it. Of course only you can publish for distribution.

Yes, will do so in a few days, as I still have to make a few changes. Please remind me via PM, if I forget about it.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #178 (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,601 received
Forum Reputation: Legendary

New Test Version for VisualSMA and VisualEMA

I have been further digging into the NinjaTrader architecture, and the result is a simpler version of the VisualSMA and the VisualEMA. The new versions were entirely recoded from scratch and the code is about 80 lines shorter than the code of the previous versions.

Simplicity always means performance gain and robustness, so here are some of the main improvements:

-> loading time of the indicator on historical data reduced by a factor 10
-> lag of the indicators reduced
-> indicators can be safely called from other indicator or strategy

The chart below shows the 20-period EMA and 20-period SMA, both calculated from a 5 minute chart, but displayed on a 50 tick chart of the FDAX 12-11.

The new indicators are attached below. After installation you will find them as NewVisualSMA or NewVisualEMA in the dropdown menu of the indicator dialogue box. These are not the final versions, but pre-versions for testing.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-fdax-12-11-50-tick-21_10_2011.jpg  
Attached Files
Register to download File Type: zip VisualIndicatorsTest.zip (41.4 KB, 992 views)

Last edited by Fat Tails; October 21st, 2011 at 04:00 PM. Reason: Indicator replaced, October 21, 3:00 PM EST
Reply With Quote
The following 20 users say Thank You to Fat Tails for this post:
 
  #179 (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


Fat Tails View Post
I have been further digging into the NinjaTrader architecture, and the result is a simpler version of the VisualSMA and the VisualEMA. The new versions were entirely recoded from scratch and the code is about 80 lines shorter than the code of the previous versions.

Simplicity always means performance gain and robustness, so here are some of the main improvements:

-> loading time of the indicator on historical data reduced by a factor 10
-> lag of the indicators reduced
-> indicators can be safely called from other indicator or strategy

The chart below shows the 20-period EMA and 20-period SMA, both calculated from a 5 minute chart, but displayed on a 50 tick chart of the FDAX 12-11.

The new indicators are attached below. After installation you will find them as NewVisualSMA or NewVisualEMA in the dropdown menu of the indicator dialogue box. These are not the final versions, but pre-versions for testing.

will playing with these have any effect on currently installed visualSMA/EMA indies?

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

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Reply With Quote
 
  #180 (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,601 received
Forum Reputation: Legendary

Lag Reduced in Strategy Mode


In strategy mode the new version has the lag reduced by one bar - this applies to cases where the bar close of the secondary bar series matches the bar close of the primary bar series.

Chart 1 shows the new Visual SMA compared to the prior version. Chart 2 shows the new Visual SMA compared to the xcMovAvg2. The reduction of the lag was obatined without repainting, which means that the VisualSMA and the VisualEMA can be used for backtesting in strategy mode.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-fdax-12-11-10-min-21_10_2011-chart-1.jpg   Coding Multi Time Frame (MTF) Indicators with NinjaTrader-fdax-12-11-10-min-21_10_2011-chart-2.jpg  
Reply With Quote
The following 6 users say Thank You to Fat Tails 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)

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 10:38 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-13 in 0.16 seconds with 20 queries on phoenix via your IP 54.226.113.250