Ehlers 2 Pole Super Smoother Filter for ThinkOrSwim

TPTrades

Member
VIP
Author states: The 2 Pole Super Smoother Filter was created by John Ehlers (Cycle Analytics For Traders pg 32) and this follows the price very closely and very useful because it is consistent with uptrends and falls sharply during a sudden downtrend so it should be able to help you stay more profitable. Buy when the indicator line turns green and sell when it turns red.

QQRCSYH.png


Here is the Tradingview link: https://www.tradingview.com/script/PAIrISU7-Ehlers-2-Pole-Super-Smoother-Filter-V2-CC/
The ToS conversion is below.
 
Last edited by a moderator:
I have this code for trading view and would like to be able to use for TOS.

Here is the trading view link: https://www.tradingview.com/script/PAIrISU7-Ehlers-2-Pole-Super-Smoother-Filter-V2-CC/

See code below:

Code:
//@version=4
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Ehlers 2 Pole Super Smoother Filter V2 [CC] script may be freely distributed under the MIT license.
study("Ehlers 2 Pole Super Smoother Filter V2 [CC]", overlay=true)

inp = input(title="Source", type=input.source, defval=close)
res = input(title="Resolution", type=input.resolution, defval="")
rep = input(title="Allow Repainting?", type=input.bool, defval=false)
bar = input(title="Allow Bar Color Change?", type=input.bool, defval=true)
src = security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length = input(title="Length", type=input.integer, defval=10, minval=1)

pi = 2 * asin(1)
a = exp(-1.414 * pi / length)
b = 2 * a * cos(1.414 * pi / length)
c2 = b
c3 = -a * a
c1 = 1 - c2 - c3

ssf = 0.0
ssf := (c1 * ((src + nz(src[1])) / 2)) + (c2 * nz(ssf[1])) + (c3 * nz(ssf[2]))

sig = src > ssf ? 1 : src < ssf ? -1 : 0
alertcondition(crossover(sig, 0), "Buy Signal", "Bullish Change Detected")
alertcondition(crossunder(sig, 0), "Sell Signal", "Bearish Change Detected")
ssfColor = sig > 0 ? color.green : sig < 0 ? color.red : color.black
barcolor(bar ? ssfColor : na)
plot(ssf, title="SSF", color=ssfColor, linewidth=2)
check below:

CSS:
# Indicator for TOS
# study("Ehlers 2 Pole Super Smoother Filter V2 [CC]", overlay=true)
# Request from useThinkScript.com member

input timeframe = AggregationPeriod.MIN;  # "Resolution"
input AllowRepainting = no;               # "Allow Repainting?"
input colorBars = yes;                    # "Allow Bar Color Change?"
input source = FundamentalType.CLOSE;     # "Source"
input length = 10;                        # "Length"

def na = Double.NaN;
def current = GetAGgregationPeriod();
def tf = Max(current, timeframe);
def last = isNaN(close);
def bar = BarNumber();
def src = Fundamental(source, Period = tf);

def ssf = EhlersSuperSmootherFilter(src, length);
def sig = if src > ssf then 1 else if src < ssf then -1 else 0;

plot ssfLine = if !last and bar > length and ssf[!AllowRepainting] then ssf[!AllowRepainting] else na;
ssfLine.AssignValueColor(if sig>0 then Color.GREEN else if sig<0 then Color.RED else Color.GRAY);
ssfLine.SetLineWeight(2);

AssignPriceColor(if !colorBars then Color.CURRENT else
                 if sig>0 then Color.GREEN else if sig<0 then Color.RED else Color.GRAY);

#-- END of CODE
 
check below:

CSS:
# Indicator for TOS
# study("Ehlers 2 Pole Super Smoother Filter V2 [CC]", overlay=true)
# Request from useThinkScript.com member

input timeframe = AggregationPeriod.MIN;  # "Resolution"
input AllowRepainting = no;               # "Allow Repainting?"
input colorBars = yes;                    # "Allow Bar Color Change?"
input source = FundamentalType.CLOSE;     # "Source"
input length = 10;                        # "Length"

def na = Double.NaN;
def current = GetAGgregationPeriod();
def tf = Max(current, timeframe);
def last = isNaN(close);
def bar = BarNumber();
def src = Fundamental(source, Period = tf);

def ssf = EhlersSuperSmootherFilter(src, length);
def sig = if src > ssf then 1 else if src < ssf then -1 else 0;

plot ssfLine = if !last and bar > length and ssf[!AllowRepainting] then ssf[!AllowRepainting] else na;
ssfLine.AssignValueColor(if sig>0 then Color.GREEN else if sig<0 then Color.RED else Color.GRAY);
ssfLine.SetLineWeight(2);

AssignPriceColor(if !colorBars then Color.CURRENT else
                 if sig>0 then Color.GREEN else if sig<0 then Color.RED else Color.GRAY);

#-- END of CODE

Awesome, great work like always @samer800 (y)
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
165 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top