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

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

VisualSMA in Replay

@Rad4633

I have tested the VisualSMA in Replay mode, and I did not encounter any problems.

The indicator plots as expected. Screenshot attached.

Attached Thumbnails
Coding Multi Time Frame (MTF) Indicators with NinjaTrader-visualsma-replay.png  
Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #272 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Interactive Brokers
Favorite Futures: forex
 
Posts: 38 since Aug 2011
Thanks: 9 given, 25 received

I'm working on a strategy which has ability to trade simultaneously 28 currency pairs.
It has built in Currency Strength Module (which is the reason for having added 28 pairs) , central bank intervention module, swing rays module,
round numbers, pivot points , fibonacci levels etc added.
All these indicators were stripped down to the core, optimized and rewritten to gather tha data on all 28 pairs and embedded into the strategy as functions.
There are no calls to any external indicator except the most simpliest like SMA, EMA, ZLEMA
I'm planing to use that simple code which I've sent to you for MTF SMA and MTF EMA.
Now my latest challenge is to embed my MTF EMA-SMA code into the strategy without calling it as an external indicator.
I use MTF EMA 5, 15, 30, 60 and 240 minutes and my main chart is BetterRenko.
Everything works fine so far on all 28 pairs, I'm just trying to shorten and optimize the code
Reason for trying to embed the code relies on the fact that anyway the strategy will add additional time frame if i call the external MTF EMA-SMA indicator, so I could add those time frames by myself and save some time here by calling the regular SMA or EMA once in every 5, 15, 30, 60, 240 minutes. There is no need for anything else.
What I'm gonna get is also the ability to access those additional 5, 15, 30, 60, 240 minutes time frames
Yeah i know its silly, I have BarsInProgress up to 163 LOL


Last edited by BankRobberNT; November 24th, 2011 at 05:48 PM.
Reply With Quote
The following user says Thank You to BankRobberNT for this post:
 
  #273 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,652 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary



grofzr View Post
I'm working on a strategy which has ability to trade on 28 currency pairs.
It has built in Currency Strength Module (which is the reason for having added 28 pairs) , central bank intervention module, swing rays module,
round numbers, pivot points , fibonacci levels etc added.
All these indicators were stripped down to the core, optimized and rewritten to gather tha data on all 28 pairs and embedded into the strategy as functions.
There are no calls to any external indicator except the most simpliest like SMA, EMA, ZLEMA
I'm planing to use that simple code which I've sent to you for MTF SMA and MTF EMA.
Now my latest challenge is to embed my MTF code into the strategy without calling it as an external indicator.
I use MTF EMA 5, 15, 30, 60 and 240 minutes and my main chart is BetterRenko.
Everything works fine so far on all 28 pairs, I'm just trying to shorten and optimize the code
Reason for trying to embed the code relies on the fact that anyway the strategy will add additional time frame if i call the external MTF indicator, so I can add those time frames by myself and save some time here by calling the regular SMA or EMA once in every 5, 15, 30, 60, 240 minutes. There is no need for anything else.
What I'm gonna get is also the ability to access those additional 5, 15, 30, 60, 240 minutes time frames
Yeah i know its silly, I have BarsInProgress up to 163 LOL

Good idea to embed the secondary bar series directly in a strategy.

I would like to know whether you manage to freeze NT with BIP 163. I bet so.

Reply With Quote
 
  #274 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Interactive Brokers
Favorite Futures: forex
 
Posts: 38 since Aug 2011
Thanks: 9 given, 25 received


Fat Tails View Post
Good idea to embed the secondary bar series directly in a strategy.

I would like to know whether you manage to freeze NT with BIP 163. I bet so.

While i had BIP 55 (28xBetterRenko and 28x60 min ) i didn't have any freezes not even during interventions, but NT constantly freeze when i loose internet connection.
Now for the additional 100'something BIP I'm still coding but the code is simple just to invoke EMA-SMA once in 5 15 30 etc minutes, will see....
My only concern is that every 240 minutes it has 28x5 FirstTickOfBar that could be a problem
I dont even use FirstTickOfBar anymore, I'm affraid it can miss the first tick here or there, i use simple comparission between stored and actual CurrentBar, this way it will catch up if has missed the first tick.


Last edited by BankRobberNT; November 24th, 2011 at 06:33 PM.
Reply With Quote
 
  #275 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Interactive Brokers
Favorite Futures: forex
 
Posts: 38 since Aug 2011
Thanks: 9 given, 25 received

Oh boy, this embeded MTF EMA-SMA is working like a charm, 7 instruments 6 timeframes, no problem.

Reply With Quote
 
  #276 (permalink)
Elite Member
Albuquerque, New Mexico/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader-Continuum(Mirus)
Favorite Futures: emini Currency and Index Futures
 
Posts: 103 since Jan 2011
Thanks: 285 given, 104 received


Fat Tails View Post
As was discovered by @grofzr, both indicators were lagging when set to CalculateOnBarClose = true. I admit that the original design of the indicators was adapted to CalculateOnBarClose = false setting, which is more difficult, so I somehow neglected this part.

Testing everything is near-impossible. You add range bars to volume bars, then there is a session break, although the indicator works on historical data and on real-time data, it may have a problem with the transition as NinjaTrader builds a hybrid bar from historical and real-time tick in a non-reproducible manner, there is the possibility of CalculateOnBarClose = false setting or CalculateOnBarClose = true setting, there are technical breaks to be considered where there is no data, as the NinjaTrader heuristics for a trading day does not allow to exclude those session breaks via a session template. Let us say it is sort of a large headache until it works.

I have now tested the updated versions with CalculateOnBarClose = true setting, and so far they passed the test.

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

Hello Fat Tails,

I know you are a busy guy and have "bigger fish to fry" than this but I'm hoping that you have on your list of things to do adding a colored slope option (green/red/yellow :: up/down/flat) for the Vis SMA and Vis EMA MTF indicators.

In the meantime though, thanks for your work on these incredible indicators. They continue to be a big part in my trading (with or without the slope color). As others has said, "They work like a charm."

Reply With Quote
The following user says Thank You to HighDesertTrader for this post:
 
  #277 (permalink)
Elite Member
New York
 
Futures Experience: Beginner
Platform: Ninjatrader
Broker/Data: IB/AMP
Favorite Futures: ES
 
Posts: 36 since Dec 2011
Thanks: 568 given, 20 received

Hi Fat Tails,

Could not get much help from Ninja support, will you please help? I just want to have a simple Ninjascript to play with. The idea is to buy when 1) MACD crossabove AVG on 1-min chart and 2) MACD >= AVG on 5-min chart. The opposite would generate a sell signal. It would be better If you can add a 8-tick Target and a 6-tick stop loss. I am not good at coding, would really appreciate your help.

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


walker View Post
Hi Fat Tails,

Could not get much help from Ninja support, will you please help? I just want to have a simple Ninjascript to play with. The idea is to buy when 1) MACD crossabove AVG on 1-min chart and 2) MACD >= AVG on 5-min chart. The opposite would generate a sell signal. It would be better If you can add a 8-tick Target and a 6-tick stop loss. I am not good at coding, would really appreciate your help.

This can be coded as a simple strategy. Unfortunately my time is limited, and I cannot spend hours for free on coding strategies. I would suggest that you try to convince somebody else, maybe here:

https://futures.io/elite-circle/1261-want-your-ninjatrader-indicator-created-free.html

If nobody responds to your request, you can either try to learn some basic C# and code it yourself or pay somebody to code it. But as we both know that anything as simple as your request does not make money, your best options would be

-> to code it yourself
-> or to find somebody who is bored and can code it

You could load one of the sample strategies, for example the MA crossover, and then modify it to use the crossover MACD/Signalline instead. That is relatively simple.


Last edited by Fat Tails; December 18th, 2011 at 04:22 AM.
Reply With Quote
 
  #279 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Interactive Brokers
Favorite Futures: forex
 
Posts: 38 since Aug 2011
Thanks: 9 given, 25 received


walker View Post
Hi Fat Tails,

Could not get much help from Ninja support, will you please help? I just want to have a simple Ninjascript to play with. The idea is to buy when 1) MACD crossabove AVG on 1-min chart and 2) MACD >= AVG on 5-min chart. The opposite would generate a sell signal. It would be better If you can add a 8-tick Target and a 6-tick stop loss. I am not good at coding, would really appreciate your help.

PLEASE TEST IT WELL! On DEMO of course.

Attached Files
Register to download File Type: zip MACDCrossOverMTFv1.0.zip (3.9 KB, 127 views)

Last edited by BankRobberNT; December 17th, 2011 at 09:29 PM.
Reply With Quote
The following 2 users say Thank You to BankRobberNT for this post:
 
  #280 (permalink)
Elite Member
New York
 
Futures Experience: Beginner
Platform: Ninjatrader
Broker/Data: IB/AMP
Favorite Futures: ES
 
Posts: 36 since Dec 2011
Thanks: 568 given, 20 received


Hi BankRobberNT,

Thanks so much for the quick coding. One issue here, if I load it in 1-min chart, it buys whenever MACD crossabove AVG regardless the MACD status on 5-min chart. If I load it in both 1-min and 5-min charts, something quite interesting happens. It buys first when MACD crossabove AVG on 1-min chart and will buy again later when MACD crossabove AVG on the 5-min chart. Also, if it buys when MACD crossabove AVG on 5-min chart (depend on what time I choose to start the replay) and later MACD crossbelow AVG on 1-min chart, it sells a contract and becomes flat. But those Target and Stoploss orders are still there. I will do more testing. Hope this does not confuse you. Really appreciate your help. I don't need a quick fix if you still want to help. Take your time as I am taking my time and learn little by little.

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 07:33 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-13 in 0.14 seconds with 20 queries on phoenix via your IP 54.196.182.102