NexusFi: Find Your Edge


Home Menu

 





Coding Multi Time Frame (MTF) Indicators with NinjaTrader


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 180 posts (562 thanks)
    2. looks_two Zondor with 19 posts (29 thanks)
    3. looks_3 madLyfe with 16 posts (10 thanks)
    4. looks_4 BankRobberNT with 14 posts (16 thanks)
      Best Posters
    1. looks_one gomi with 3.7 thanks per post
    2. looks_two Fat Tails with 3.1 thanks per post
    3. looks_3 Zondor with 1.5 thanks per post
    4. looks_4 BankRobberNT with 1.1 thanks per post
    1. trending_up 186,647 views
    2. thumb_up 743 thanks given
    3. group 87 followers
    1. forum 424 posts
    2. attach_file 166 attachments




 
Search this Thread

Coding Multi Time Frame (MTF) Indicators with NinjaTrader

  #141 (permalink)
 
madLyfe's Avatar
 madLyfe 
Des Moines, Iowa
 
Experience: None
Platform: Ninja, TOS
Broker: AMP/CQG, TOS
Trading: CL, TF, GC
Posts: 1,641 since Feb 2011
Thanks Given: 9,220
Thanks Received: 1,020

so fat tails, your saying we shouldnt be using visual mode but strategy mode?

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

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
Build trailing stop for micro index(s)
Psychology and Money Management
Exit Strategy
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
  #142 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


madLyfe View Post
so fat tails, your saying we shouldnt be using visual mode but strategy mode?


Equidistant Bar Spacing

The VisualMode replicates the SMA as it would be shown on a separate DataSeries. You could for example add a secondary DataSeries to your chart, set it to transparent (invisible) and then move it to the main panel. Then you can apply the default SMA to that DataSeries.

As an alternative you can apply the VisualSMA to the first DataSeries and specify the secondary bars via indicator panel.

The only visible difference should be:

-> the first chart will show unevenly spaced bars
-> the second chart has the bars evenly spaced


Repainting

If you set the default SMA which uses the second DataSeries to CalculateOnBarClose = false, it will repaint with every tick the distance between the last, current invisible candle and the prior candle. All indicators do repaint the indicator value for the developing bar in CalculateOnBarClose = false mode.

In VisualMode, the VisualSMA simply mimics this behaviour, but relative to the primary DataSeries the repainting can cover a distance of several bars. This repainting over several bars makes it unusable. when called by strategies or indicators.


StrategyMode

The StrategyMode does not repaint. The indicator can be used by other indicators and strategies in StrategyMode. However it will not produce any interpolation of datapoints, but you will see a step function.

Started this thread Reply With Quote
Thanked by:
  #143 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Had a look at the VisualSMA as well. The chart below shows that compared to the original SMA it comes very close, but there is a minor lag. After all it needs a candle to be displayed. I will still further test its behaviour.

Attached Thumbnails
Click image for larger version

Name:	6E 09-11 (4 Range) _ 6E 09-11 (10 Range)  05_09_2011.jpg
Views:	278
Size:	98.2 KB
ID:	48407  
Started this thread Reply With Quote
Thanked by:
  #144 (permalink)
 
perryg's Avatar
 perryg 
Rechovot
 
Experience: Advanced
Platform: NinjaTrader
Broker: CQG
Trading: Index,Currency and Energy futures
Posts: 1,644 since Jan 2010
Thanks Given: 508
Thanks Received: 6,288


Fat Tails View Post
Had a look at the VisualSMA as well. The chart below shows that compared to the original SMA it comes very close, but there is a minor lag. After all it needs a candle to be displayed. I will still further test its behaviour.

Hello @Fat Tails
I believe since my webinar and showing people the use of the VisualSMA, you have been queried with dozens of questions as to the accuracy of the indicator i.e. is it lagging by one bar or not and many other questions. First of all I apologize for creating all this fuss. In MHO I think that people did not understand the use of using a HTF indicator and how to read it. The use of a 10 or 8 range on a 4 range chart is to show the DIRECTION of the trend and no more. In your chart today you show that no matter if it lags or not, the TREND is the same, and that is the main idea. The decision making in my use of this setup will NOT change as can been seen from your charts.
Once again thank you for an excellent indicator, it is far more advanced than the usual way NT uses HTF on one chart. I owe you one !!!!!

Reply With Quote
Thanked by:
  #145 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


perryg View Post
Hello @ Fat Tails
I believe since my webinar and showing people the use of the VisualSMA, you have been queried with dozens of questions as to the accuracy of the indicator i.e. is it lagging by one bar or not and many other questions. First of all I apologize for creating all this fuss. In MHO I think that people did not understand the use of using a HTF indicator and how to read it. The use of a 10 or 8 range on a 4 range chart is to show the DIRECTION of the trend and no more. In your chart today you show that no matter if it lags or not, the TREND is the same, and that is the main idea. The decision making in my use of this setup will NOT change as can been seen from your charts.
Once again thank you for an excellent indicator, it is far more advanced than the usual way NT uses HTF on one chart. I owe you one !!!!!

@perryg : No problem, I am currently reviewing the indicator. It is a complex puece of code, so I may find ways to improve it. Will come back with the results.

Started this thread Reply With Quote
Thanked by:
  #146 (permalink)
 
PandaWarrior's Avatar
 PandaWarrior 
In the heat
 
Experience: None
Posts: 3,165 since Mar 2010
Thanks Given: 6,329
Thanks Received: 13,404

Having an SMA from a five min chart on my range chart is outstanding, however, it appears to have stopped working today. Attached is a pic from my range chart with a 21visual SMA from a 5 min chart.

[screenshot]http://screencast.com/t/XQeuGtBT[/screenshot]....can someone tell me how to make my jing screenshots show up in the post. I thought this was the way but obviously I am wrong.

2011-09-05_1532 - aztrader9's library

Simplicity is the ultimate sophistication, Leonardo da Vinci


Most people chose unhappiness over uncertainty, Tim Ferris
Reply With Quote
  #147 (permalink)
 
PandaWarrior's Avatar
 PandaWarrior 
In the heat
 
Experience: None
Posts: 3,165 since Mar 2010
Thanks Given: 6,329
Thanks Received: 13,404

Re started ninja, entirely new look to the charts. Not sure what happened there but it appears to be correct now.

2011-09-05_1617 - aztrader9's library

Simplicity is the ultimate sophistication, Leonardo da Vinci


Most people chose unhappiness over uncertainty, Tim Ferris
Reply With Quote
  #148 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


PandaWarrior View Post
Having an SMA from a five min chart on my range chart is outstanding, however, it appears to have stopped working today. Attached is a pic from my range chart with a 21visual SMA from a 5 min chart.

[screenshot]http://screencast.com/t/XQeuGtBT[/screenshot]....can someone tell me how to make my jing screenshots show up in the post. I thought this was the way but obviously I am wrong.

2011-09-05_1532 - aztrader9's library

I have no idea, why it stopped working. Could you please tell me

(1) whether your chart shows real-time data or historical data
(2) whether refreshing the chart via F5 changes anything
(3) whether the problem also occurs with conventional range bars (as opposed to RangeNoGap bars).

Started this thread Reply With Quote
  #149 (permalink)
 
PandaWarrior's Avatar
 PandaWarrior 
In the heat
 
Experience: None
Posts: 3,165 since Mar 2010
Thanks Given: 6,329
Thanks Received: 13,404


Fat Tails View Post
I have no idea, why it stopped working. Could you please tell me

(1) whether your chart shows real-time data or historical data
(2) whether refreshing the chart via F5 changes anything
(3) whether the problem also occurs with conventional range bars (as opposed to RangeNoGap bars).

1) Real time
2) F5 does not APPEAR to change anything.
3) I will need to see about the RangeNoGap bars. I've only had them on the chart for two days. Previously used conventional range bars.

I will report any future abnormalities as I discover them.

Simplicity is the ultimate sophistication, Leonardo da Vinci


Most people chose unhappiness over uncertainty, Tim Ferris
Reply With Quote
Thanked by:
  #150 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Braulio View Post
Fat Tails,

I'm using the latest version of the anaVisualSMA and today I noticed the following on my charts :

You can see on the attached pictures that the first one(TRADE#8) was taken yesterday while I was trading, and the second one was taken at the exact same spot today(after shutting down my computer and closing ninja).

The VisualSMA's look different but everything else is in place.

Thanks.

B

@Braulio: I have had a look at the VisualSMA and VisualEMA again. In VisualMode and real-time the indicator plotted in an inconsistent way, as there was a bug in the interpolation algorithm. I have now recoded that section of the indicator, and the tests which I have made suggest that the problem is solved.

The updated indicators are here:




The chart below shows the new version (blue) compared to the old version (red, dashed). Below is the SMA, which is directly calculated from 8 range bars (orange) for comparison.

Could you please check and confirm that it now works as expected.

Attached Thumbnails
Click image for larger version

Name:	VisualSMA Real-Time.jpg
Views:	264
Size:	93.2 KB
ID:	48511  
Started this thread Reply With Quote




Last Updated on April 19, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts