NexusFi: Find Your Edge


Home Menu

 





Logic that creates the SuperTrend Indicator


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Jerryflyguy with 6 posts (6 thanks)
    2. looks_two cmacdon with 5 posts (3 thanks)
    3. looks_3 Dynamitetrader with 5 posts (5 thanks)
    4. looks_4 kareem40 with 2 posts (0 thanks)
      Best Posters
    1. looks_one Fat Tails with 8 thanks per post
    2. looks_two Jerryflyguy with 1 thanks per post
    3. looks_3 Dynamitetrader with 1 thanks per post
    4. looks_4 cmacdon with 0.6 thanks per post
    1. trending_up 7,465 views
    2. thumb_up 26 thanks given
    3. group 118 followers
    1. forum 26 posts
    2. attach_file 6 attachments




 
Search this Thread

Logic that creates the SuperTrend Indicator

  #1 (permalink)
 Jerryflyguy 
Moose Jaw Saskatchewan Canada
 
Experience: Advanced
Platform: Qtrader - CQG
Trading: Ag's
Posts: 14 since Oct 2018
Thanks Given: 2
Thanks Received: 9

Does anyone have a logic description of the supertrend indicator? I'd like to try my hand at writing my own copy of it for CQG (or.. if someone knows where this has been done I'm not above using someone else's indicator )

I've not been able to find a description of what the logic is behind the indicator?

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
Increase in trading performance by 75%
The Elite Circle
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
My NQ Trading Journal
12 thanks
  #3 (permalink)
 
OldGerman's Avatar
 OldGerman 
Münster Germany
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader, ProRealtime
Broker: NinjaTrader Brokerage
Trading: FDXM, FDAX, ES, YM, 6B and 6E
Posts: 588 since Mar 2015
Thanks Given: 656
Thanks Received: 1,290


Hi ,
take a look here. https://www.tradesignalonline.com/lexicon/view.aspx?id=Supertrend

In the upper area are two links to the source code.
I wish you success

The biggest risk you can ever take is not betting on yourself!
(Bill Williams +)
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
joker542
New Delhi
 
Posts: 1 since Aug 2019
Thanks Given: 0
Thanks Received: 1

BASIC UPPERBAND = (HIGH + LOW) / 2 + Multiplier * ATR
BASIC LOWERBAND = (HIGH + LOW) / 2 - Multiplier * ATR

FINAL UPPERBAND = IF( (Current BASICUPPERBAND < Previous FINAL UPPERBAND) and (Previous Close > Previous FINAL UPPERBAND)) THEN (Current BASIC UPPERBAND) ELSE Previous FINALUPPERBAND)

FINAL LOWERBAND = IF( (Current BASIC LOWERBAND > Previous FINAL LOWERBAND) and (Previous Close < Previous FINAL LOWERBAND)) THEN (Current BASIC LOWERBAND) ELSE Previous FINAL LOWERBAND)

SUPERTREND = IF(Current Close <= Current FINAL UPPERBAND ) THEN Current FINAL UPPERBAND ELSE Current FINAL LOWERBAND

Reply With Quote
Thanked by:
  #5 (permalink)
Dynamitetrader
Seka, Thailand
 
Posts: 8 since Aug 2019
Thanks Given: 1
Thanks Received: 8


Jerryflyguy View Post
Does anyone have a logic description of the supertrend indicator? I'd like to try my hand at writing my own copy of it for CQG (or.. if someone knows where this has been done I'm not above using someone else's indicator )

I've not been able to find a description of what the logic is behind the indicator?

A super trend indicator in my mind is a myth, you can use moving averages to a degree and many other indications that you can see by eye, but nothing anyone creates can beat volume, because volume is where its at. Volume moves the marlkets without question, so any indicator is only reflecting what is happening in volume anyway, so why not go to the source of the reasons why indicators show what they show?

Any indicator shows indications because something has made it show and it lags behind what is causing the indications. My advice - Study Volume, Study VSA principles, Study Volatility which is representative of the fast or slow pace of buying and selling exchange. It's a zero sum game, but volatility shows the desire on the bid and ask in the DOM!

Peronally I have dumped all indicators other than true volume, volatility and price action, price action is also showing what volume is telling you. the open, the high, the low and the close are all reference points, so that is why I don't use candles also, I like clear price bars showing gaps too.

Super Volume, Super Volatility - and lack of Volatility and compare the two indications and look back in history to see what is likely in the future!

Volume and Volatility is my Dynamite!

Reply With Quote
Thanked by:
  #6 (permalink)
 Jerryflyguy 
Moose Jaw Saskatchewan Canada
 
Experience: Advanced
Platform: Qtrader - CQG
Trading: Ag's
Posts: 14 since Oct 2018
Thanks Given: 2
Thanks Received: 9

DynamiteTrader your post is VERY intriguing to me. I've been searching for a volume/volatility indicator that works for me as I to believe that this is a needed component of a trading system. However, that said... I've not found any that really that fit the bill!

I'm curious as to what you've found that works and how you use it?

Thanks!

J

Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
Dynamitetrader
Seka, Thailand
 
Posts: 8 since Aug 2019
Thanks Given: 1
Thanks Received: 8


Jerryflyguy View Post
DynamiteTrader your post is VERY intriguing to me. I've been searching for a volume/volatility indicator that works for me as I to believe that this is a needed component of a trading system. However, that said... I've not found any that really that fit the bill!

I'm curious as to what you've found that works and how you use it?

Thanks!

J

It's all so simple really, first set your chart to colour volume and price bars the same, red for lower close than previous close and green for higher close than previous close! Overlay HVOL on your volume chart. I never trade tops or bottoms of day trends or higher, but wait for impetus - volume to confirm a desire to move in a direction, up or down, volatility should increase with any volume increase with market moves up or down, any decrease generally does not confirm the move and actually belies makret manipultion potential.

Volume increase and lack of volume shows where the interest in market direction lies. Block buying and block selling in larger numbers than usual will help you see where the institutions are trading. This is my Dynamite!

Good luck, let me know which markets you trade! I trade futures only!

Reply With Quote
Thanked by:
  #8 (permalink)
 cmacdon 
Brisbane Queensland Australia
 
Experience: Advanced
Platform: Ninja Bullcharts
Trading: Stocks
Posts: 15 since Dec 2014
Thanks Given: 0
Thanks Received: 20


Jerryflyguy View Post
DynamiteTrader your post is VERY intriguing to me. I've been searching for a volume/volatility indicator that works for me as I to believe that this is a needed component of a trading system. However, that said... I've not found any that really that fit the bill!

I'm curious as to what you've found that works and how you use it?

Thanks!

J

Following this thread, I would suggest that volume can be measured and broken down into reconciled amounts of buying and selling volume components by various methods, but then you have to convert those buying and selling volume "amount" measurements into "force" of supply & demand measurements. You can have strong forces at work on low total volume bars and weak forces at work on large total volume bars. What you need is the right indicators to point you in the right direction.

The same right indicators will demonstrate that volatility is a price effect and not a cause of price movements. My thoughts are that volatility is a distraction for a lot of people trying to measurie the wrong thing.

In summary , you need to get down to measuring the forces of supply & demand not the amount of buying volume and selling volume in order to perceive the cause behind price movements.

My analogy is that it is not the size of the armies that went into battle (total Volume) but how fierce the soldiers fought( which is a force measurement irrespective of the total volume).

Regards

cmacdon

Reply With Quote
Thanked by:
  #9 (permalink)
Dynamitetrader
Seka, Thailand
 
Posts: 8 since Aug 2019
Thanks Given: 1
Thanks Received: 8


cmacdon View Post
Following this thread, I would suggest that volume can be measured and broken down into reconciled amounts of buying and selling volume components by various methods, but then you have to convert those buying and selling volume "amount" measurements into "force" of supply & demand measurements. You can have strong forces at work on low total volume bars and weak forces at work on large total volume bars. What you need is the right indicators to point you in the right direction.

The same right indicators will demonstrate that volatility is a price effect and not a cause of price movements. My thoughts are that volatility is a distraction for a lot of people trying to measurie the wrong thing.

In summary , you need to get down to measuring the forces of supply & demand not the amount of buying volume and selling volume in order to perceive the cause behind price movements.

My analogy is that it is not the size of the armies that went into battle (total Volume) but how fierce the soldiers fought( which is a force measurement irrespective of the total volume).

Regards

cmacdon

Indeed the volume does not show you the balance between buying and selling, supply or no supply, demand or no demand, but that buying and selling has taken place and thus the quantity of trade exchanges. The volatility shows the rapidity, not of price effect, but the willingness of the traders to get involved in the exchange of contracts, it's the emergency with which the desire to exchange is portrayed creating volatility based on what the crowd of traders percieve and thus create volatility or not! A lack of volatility then, is quite the opposite and shows receding interest, just as receding volume and is therefore very often an indication of an undesired directional movement!

I would add to your analogy with, it's not just how fierce the soldiers fought, but the quality of their weapons! 95% or greater get this wrong, so size is not the issue here!

Reply With Quote
Thanked by:
  #10 (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


There are several volatility based trailing stops that you may use. All of them use the ATR such that there will be a wide stop when volatility is high, but a narrower stop when the market calms down.

Here are some example for a long stop. The short stop would be defined the opposite way.


ATR Trailing Stop: A multiple of the ATR is deducted from the current close.

Chandelier Stop A: A multiple of the ATR is deducted from a Donchian high

Chandelier Stop B: A multiple of the ATR is deducted from the highest high since in position

SuperTrend: A multiple of the ATR is deducted from a moving average


Coding these indicator is fairly simple. The starting point would be the current close, the highest high over a selected lookback period of a moving average. In a second step you simply deduct a multliple of the ATR over a selected lookback period.

Below are screenshots attached showing the different trailing stops.



ATR Trailing Stop:




Chandelier Stop A:




Chandelier Stop B:




SuperTrend (Median):


Reply With Quote




Last Updated on February 7, 2021


© 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