NexusFi: Find Your Edge


Home Menu

 





Configuring anaSuperTrend


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 16 posts (36 thanks)
    2. looks_two Zefi with 6 posts (0 thanks)
    3. looks_3 gdstuart with 5 posts (1 thanks)
    4. looks_4 sagetrade with 4 posts (0 thanks)
    1. trending_up 14,164 views
    2. thumb_up 37 thanks given
    3. group 17 followers
    1. forum 39 posts
    2. attach_file 14 attachments




 
Search this Thread

Configuring anaSuperTrend

  #31 (permalink)
toast
JERSEY CITY
 
Posts: 1 since Nov 2017
Thanks Given: 1
Thanks Received: 0

Hello,

I want to add SuperTrend indicator for ThinkorSwim, but unable to get one. I tried bit programming and it doesn't seem to be accurate.


Is there a ThinkScript available for SuperTrend?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
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
The Program
20 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #32 (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


kashyapjdave View Post
First of all, I would like to Thank You for all the Indicators, your valuable knowledge to solve all User queries & this helpful Platform. I have got many of my queries solved by searching through the posts where you shared your knowledge and explained ways to achieve the results.


I have a query for TSSupertrend Indicator for Ninjatrader 8 and would like to see same output results in amaSuperTrendU11 in Ninjatrader 8. Can you please help me out to achieve similar results in amaSuperTrend11 / basically I want to replicate TSSupertrend results in amaSuperTrendU11


Right now using the following parameters in TSSupertrend:
Supertrend mode : ATR
Period : 14
Multiplier : 3.2
Moving Average Type : HMA
Smooth : 14


Let me first list the differences between the TSSuperTrend and the anaSuperTrendU11. I am referring to the indicator versions for NinjaTrader 7.

(1) The TSSuperTrend calculates the stop line by using data from the current bar. This means that the stop is being recalculated with every single tick, if you set the indicator to CalculateOnBarClose = false. As the SuperTrend is a trailing stop it can only move towards price, but not move away from price. In my understanding it does not make sense that a trailing stop moves towards price intra-bar, but it should be price that hits the stop and not otherwise. That said the SuperTrend will only move towards price intra-bar, when price moves away from the stop. This shows that all the calculations intra-bar are completely redundant. The anaSuperTrendU11 does not perform those redundant calculations but the stop is calculated from the moving average and the average true range one bar ago. This explains why it is named U11.

(2) The anaSuperTrendU11 has an option to trigger reversals intra-bar. This option is deactivated by default. Even when it is used with the setting CalculateOnBarClose = false, it will not trigger intra-bar, but at the bar close - unless the intra-bar option is selected.

(3) When the stop is hit - close beyond the line - the anaSuperTrendU11 still shows the stop line. NinjaTrader identifies the close beyond the line when it completes the bar, which is the case with the first tick of the consecutive bar. Therefore anaSuperTrendU11 shows the new stop for the next bar only. It is important here to understand the difference between the signal bar (breach of the stop) and the entry bar (bar after the signal bar). TSSuperTrend already draws a new stop on the other side of the price action for the signal bar. This is a fake stop, because it can only be calculated once the bar is complete. The stop even becomes obsolete, before it is possible to enter a new position with the first tick of the entry bar.

(4) The calculation of the initial stop done by the anaSuperTrendU11 is slightly different then the calculation of the initial stop performed by the TSSuperTrend.


Approximation of the TSSuperTrend with the anaSuperTrendU11 (NinjaTrader 7)

Please find below a chart that shows how you may obtain similar results with the anaSuperTrendU11 when compared to the TSSuperTrend. All that is needed is to adjust the settings.

Settings TSSupertrend
Supertrend mode : ATR
Period : 14
Multiplier : 3.2
Moving Average Type : HMA
Smooth : 14

Settings anaSuperTrendU11
Baseline Smoothing: HMA
Offset Smoothing: EMA
Offset Type: True_Range
Baseline period: 14
Offset multiplier 3.2
Offset period: 27

The only difficulty here is that the original ATR uses Wilder's average for smoothing. Wilder's MA is an exponential moving average that uses a smoothing constant of k=1/N, while the EMA is an exponential moving average that uses a smoothing constant of k = 2/(n+1), where N is the lookback period of the moving average. The TSSuperTrend uses a Wilder(14) with a smoothing constant of k = 1/14. This is identical with an EMA(27) with a smoothing constant of k = 2/(27+1).

I have now added the two indicators to the same chart. As you will notice the anaSuperTrendU11 lags by one bar compared to the TSSuperTrend. This is because the TSSuperTrend is recalculated intra-bar, while the anaSuperTrendU11 uses the prior bar.

However, this lag only occurs when price (the bar close) moves away from the stop. In case that price approaches the stop there is no lag at all! Please scroll through a chart and you will notice that the stop is breached by exactly the same bar for both indicators.

The only difference here is that the TSSupertrend already draws a fake stop for the signal bar. This stop is used as a maximum (short stop) or minimum (long stop) for the stop calculation for the next bar, which explains that the anaSuperTrendU11 sometimes draws a wider initial stop than the TSSuperTrend.




Approximation of the TSSuperTrend with the amaSuperTrendU11 (NinjaTrader 8)

The amaSuperTrendU11 for NinjaTrader 8 also allows for selecting Wilder's Average, so it is not necessary to make the conversion of the indicator period from 14 to 27.

Please select the following settings for the amaSuperTrendU11:

Baseline smoothing: HMA
Offset formula: True_Range
Offset smoothing: Wilder

Baseline period: 14
Offset period: 14
Offset multiplier: 3.2

With these settings it will show near-identical results to the anaSuperTrendU11.


Reply With Quote
Thanked by:
  #33 (permalink)
 nxfradar 
HK + HK
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: futures
Posts: 13 since Mar 2017
Thanks Given: 7
Thanks Received: 4


Fat Tails,

Thanks a lot for explaining all the stuff in detail and going through each and every detail at the fullest.

As a Beginner on this platform, I am sorry for posting earlier post in the different Thread.

Reply With Quote
  #34 (permalink)
 nttradert 
London/United Kingdom
 
Experience: Intermediate
Platform: NinjaTrader, Omnitrader
Trading: Emini YM
Posts: 16 since Jun 2017
Thanks Given: 22
Thanks Received: 39


Fat Tails View Post
I haven't posted it yet. Still working on it. Currently trying to translate indicators to NinjaTrader 8.

As always, fantastic indicators. Any follow up when the Dual version of the SuperTrendU11 will be released for NT8?

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


nttradert View Post
As always, fantastic indicators. Any follow up when the Dual version of the SuperTrendU11 will be released for NT8?

In the meantime you could add the amaSuperTrendU11 to your chart twice.

The dual version just has some colors added to the two SuperTrends.

It will come later this year. No priority, as you may use two instances of the amaSuperTrendU11 now.

Reply With Quote
  #36 (permalink)
 nttradert 
London/United Kingdom
 
Experience: Intermediate
Platform: NinjaTrader, Omnitrader
Trading: Emini YM
Posts: 16 since Jun 2017
Thanks Given: 22
Thanks Received: 39


Fat Tails View Post
In the meantime you could add the amaSuperTrendU11 to your chart twice.

The dual version just has some colors added to the two SuperTrends.

It will come later this year. No priority, as you may use two instances of the amaSuperTrendU11 now.

Thanks for the prompt reply. I am currently using 2 instances of the indicator and you maths (mine sucks) as suggested in one of your previous posts.

Reply With Quote
  #37 (permalink)
 ClutchAce 
Cookeville, TN
 
Experience: Advanced
Platform: Sierra Chart, IB, Python
Trading: NQ, DAX, TOPIX
Frequency: Daily
Duration: Hours
Posts: 71 since Oct 2011
Thanks Given: 18
Thanks Received: 21

Hi @FatTails, I'm a paid member of your site, great library you've got.

There is a similar indicator in Thinkorswim to SuperTrend, which Eric Purdy of Thinkscripter/Simplerindicators.com coded (but I can't find an official page for anymore on those sites) - it's called 'Multistops' and I'm trying to match the parameters in his script to yours - could you review these and comment on what looks to be the most likely for match for Baseline period, Offset period, and Offset multiplier in SuperTrend, to MS's 'VolatilityCoefficient', 'VolatilityStopLookBackLength', 'FibStopRatio', and 'FibStopLookBackLength'?

https://s55.photobucket.com/user/flexshock55/media/Multistops-params-vs-SuperTrendU11-params.png.html

https://s55.photobucket.com/user/flexshock55/media/Multistops.png.html

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


ClutchAce View Post
Hi @FatTails, I'm a paid member of your site, great library you've got.

There is a similar indicator in Thinkorswim to SuperTrend, which Eric Purdy of Thinkscripter/Simplerindicators.com coded (but I can't find an official page for anymore on those sites) - it's called 'Multistops' and I'm trying to match the parameters in his script to yours - could you review these and comment on what looks to be the most likely for match for Baseline period, Offset period, and Offset multiplier in SuperTrend, to MS's 'VolatilityCoefficient', 'VolatilityStopLookBackLength', 'FibStopRatio', and 'FibStopLookBackLength'?

Multistops-params-vs-SuperTrendU11-params.png Photo by flexshock55 | Photobucket

Multistops.png Photo by flexshock55 | Photobucket

I do not know the Thinkorswim indicator. It does not look like the SuperTrend.

The SuperTrend does not use any fib ratios.

Reply With Quote
  #39 (permalink)
 ClutchAce 
Cookeville, TN
 
Experience: Advanced
Platform: Sierra Chart, IB, Python
Trading: NQ, DAX, TOPIX
Frequency: Daily
Duration: Hours
Posts: 71 since Oct 2011
Thanks Given: 18
Thanks Received: 21


Fat Tails View Post
I do not know the Thinkorswim indicator. It does not look like the SuperTrend.

The SuperTrend does not use any fib ratios.

Sorry, I should have presented it better - the FibStops are *only* relevant when the stop calculation method is actually set to 'Fibonacci' - in the screenshot which I linked to earlier, the method is 'Wilders Average' like Supertrend.

The stops are not as visible in the chart example which I posted, but they are there. I just checked with the author, the stop calculations are a style of "basic ATR trailing stop", and that the FibStop is his "own idea and uses a fib ratio of the prior swing to set the stop."

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



ClutchAce View Post
Sorry, I should have presented it better - the FibStops are *only* relevant when the stop calculation method is actually set to 'Fibonacci' - in the screenshot which I linked to earlier, the method is 'Wilders Average' like Supertrend.

The stops are not as visible in the chart example which I posted, but they are there. I just checked with the author, the stop calculations are a style of "basic ATR trailing stop", and that the FibStop is his "own idea and uses a fib ratio of the prior swing to set the stop."


To comment on it I would need to know the formula and have a screenshot to have a look at it.

Reply With Quote




Last Updated on March 2, 2018


© 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