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,462 views
    2. thumb_up 743 thanks given
    3. group 87 followers
    1. forum 424 posts
    2. attach_file 166 attachments




 
 

Coding Multi Time Frame (MTF) Indicators with NinjaTrader

 
 
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


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

You should compare the old VisualSMA against the new VisualSMA and you will find that they are very similar, except that the lag was reduced.

Below is a comparison (on historical data) of the VisualSMA and the NewVisual SMA. If you look at the data box you will see that the new VisualSMA leads the old VisualSMA in an upmove.


Started this thread

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
 
 
Rocketdog's Avatar
 Rocketdog 
Newcastle Australia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: 6E
Posts: 60 since Jun 2011
Thanks Given: 98
Thanks Received: 62


Fat Tails View Post
You should compare the old VisualSMA against the new VisualSMA and you will find that they are very similar, except that the lag was reduced.

Below is a comparison (on historical data) of the VisualSMA and the NewVisual SMA. If you look at the data box you will see that the new VisualSMA leads the old VisualSMA in an upmove.




I can't explain why but the old Visual SMA works for me. Maybe it's a better fit with the RenkoHybrid bars. I've been trading my live account for part of October and all of November with an almost 100% success rate. I really don't want to change anything. I want to keep the same set-up and hopefully become more confident with what I have.

Thanked by:
 
 dexter 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: 6E
Posts: 7 since Feb 2010
Thanks Given: 137
Thanks Received: 22



Rocketdog View Post
I can't explain why but the old Visual SMA works for me. Maybe it's a better fit with the RenkoHybrid bars. I've been trading my live account for part of October and all of November with an almost 100% success rate. I really don't want to change anything. I want to keep the same set-up and hopefully become more confident with what I have.

Rocketdog,

If somebody hasn't provided it already, I think this is what you're looking for - the 'ana' indicator prior to Fat Tails' latest Visual SMA.

-Dexter

Attached Files
Elite Membership required to download: anaShadedMAs.zip
Thanked by:
 
 
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


dexter View Post
Rocketdog,

If somebody hasn't provided it already, I think this is what you're looking for - the 'ana' indicator prior to Fat Tails' latest Visual SMA.

-Dexter

Sorry the anaShadedMAs has nothing to do with the Visual SMA, it is not a multi-timeframe indicator but a simple set of two moving averages.

I will not make the old version of the VisualSMA available to the public again, because the newer version is more accurate, more robust and much faster to load. Also, I have not seen a single argument so far in favor of the old indicator.

If anybody wants an older version of the VisualSMA, please send me a private message. I will then make it available, but would like to understand the reasons, why somebody would prefer it to the new version.

Started this thread
Thanked by:
 
 
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


madelynnjohnson View Post
Rocketdog,

Can you still select the indicator when you have a chart up or has that gone as well? I'm not quite sure why I can still select the anaVisual SMA from a list of indicators when I have a chart up and not have it show in the master indicator list when you try to edit an indicator. Anyone out there have any ideas?

Madelynn

@madelynnjohnson:

The indicator is distributed as a protected and compiled assembly. All compiled indicators will not show in the master list and cannot be edited.

Started this thread
Thanked by:
 
 
prisonbreaker82's Avatar
 prisonbreaker82 
Rio de Janeiro
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire, IB
Trading: Equity & Futures
Posts: 312 since Jun 2010
Thanks Given: 58
Thanks Received: 141


Fat Tails View Post
@prisonbreaker82: I can save the template here. Do not really know, what causes your problem. If you wish contact me via private message, so that I can have a look at your chart template.

It works great now with the final version installed. strange... Does not matter as I can now save my templates..

thanks

Visit my NexusFi Trade Journal
Thanked by:
 
 BankRobberNT 
NYC
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Interactive Brokers
Trading: forex
Posts: 38 since Aug 2011

Visual EMA core engine:
-----------------------------
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
double xEMA = (CurrentBars[1] == 0 ? Inputs[1][0] : Inputs[1][0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
return;
}
if (BarsInProgress == 0)
{
Value.Set(xEMA);
}
return;
}
------------------------------------------------------------------------------------------
VisualSMA core:
------------------------------------------------------------------------------------------
protected override void OnBarUpdate()
{

if (BarsInProgress == 1)
{
if (CurrentBars[1] == 0)
xSMA = (Inputs[1][0]);
else
{
double last = Value[1] * Math.Min(CurrentBars[1], Period);

if (CurrentBars[1] >= Period)
xSMA = ((last + Inputs[1][0] - Inputs[1][Period]) / Math.Min(CurrentBars[1], Period));
else
xSMA = ((last + Inputs[1][0]) / (Math.Min(CurrentBars[1], Period) + 1));
}
return;
}
if (BarsInProgress == 0)
{
Value.Set(xSMA);
}
return;

}

 
 
PHXtrader's Avatar
 PHXtrader 
Boston
 
Experience: Intermediate
Platform: Jigsaw
Trading: NQ
Posts: 84 since Apr 2011
Thanks Given: 48
Thanks Received: 76

Fat Tails ,


Your new versions of your indicators are Great! I use them extensively on many of my charts and the load times have been cut down significantly.

I use 4 of your ema's and 4 of your sma's on one chart which leads me to a question or maybe a suggestion for a rainy day addition. (if you think its a useful idea of coarse)

Is it possible to add a user defined text field that would display on the MA line itself or maybe the hard right edge of the chart where the MA line ends. That way you could label each line for quick ref. (5R or 5min or 5T ect.)

It's just hard to keep track of which line is which when you have 8 different ones on the same chart.

Thanks

Visit my NexusFi Trade Journal
 
 
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


PHXtrader View Post
Fat Tails ,


Your new versions of your indicators are Great! I use them extensively on many of my charts and the load times have been cut down significantly.

I use 4 of your ema's and 4 of your sma's on one chart which leads me to a question or maybe a suggestion for a rainy day addition. (if you think its a useful idea of coarse)

Is it possible to add a user defined text field that would display on the MA line itself or maybe the hard right edge of the chart where the MA line ends. That way you could label each line for quick ref. (5R or 5min or 5T ect.)

It's just hard to keep track of which line is which when you have 8 different ones on the same chart.

Thanks

I could add labels, or alternatively you could reduce the number of indicator that you use.

Do you really think that you get an advantage by using 8 of them on a single chart ?

Started this thread
 
 
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



grofzr View Post
Visual EMA core engine:
-----------------------------
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
double xEMA = (CurrentBars[1] == 0 ? Inputs[1][0] : Inputs[1][0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
return;
}
if (BarsInProgress == 0)
{
Value.Set(xEMA);
}
return;
}

The code can be used for a strategy, however - even if compared with the strategy mode of the VisualEMA - it is quite a bit different.

Accuracy on Backtests:

I will only compare it to the strategy mode. The strategy mode of the VisualEMA is specificly designed for use with historical data, and has the lag eliminated as much as possible, without repainting. On the chart below you will see that the real VisualEMA leads the indicator which was coded as above by one bar. This increases the accuracy of any backtest.

The VisualMode is even more accurate, but it repaints over the interpolation period. It should not be compared to the code snippet above. The same applies to the One-Tick-Correction mode.

CalculateOnBarClose = false:

Again the VisualEMA can be used in CalculateOnBarClose = false mode in strategy mode. There is a small lag for the first bars after the transition from historical to real-time data, but this is the price to be paid for the lag reduction on historical data. You cannot have both. The yellow indicator which follows the code above, cannot be easily used in CalculateOnBarClose = false mode, as it will neither produce a step function nor an interpolated indicator.

Attached Thumbnails
Click image for larger version

Name:	ES 12-11 (1 Min)  22_11_2011.jpg
Views:	255
Size:	100.2 KB
ID:	55424  
Started this thread

 



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