Attachments forums

Re: Ehlers Indicators for TradeStation

Banzai, Tue Oct 13, 2026 5:22 am

Adaptive SuperSmoother

Links: |TradingView|TradeStation|NinjaTrader|MT4|MT5|Python|

TradeStation: September 2026

In “Adaptive SuperSmoother” in this issue, John Ehlers presents an adaptive version of his SuperSmoother filter. The article describes how the filter can be made adaptive while maintaining the improved filtering characteristics of his original SuperSmoother, offering an alternative to EMA-based smoothing approaches. The EasyLanguage implementation plots both the original and adaptive SuperSmoother filters for comparison and can be modified to plot the difference between the two if an oscillator is preferred.

A sample chart is shown in Figure 2.

Sample Chart FIGURE 2: TRADESTATION. This demonstrates a daily chart of the continuous emini S&P 500 futures symbol, showing a portion of 2026 with both the original and adaptive SuperSmoother filters applied.

Code: Select all

Indicator: Adaptive SuperSmoother

{
	Adaptive SuperSmoother
	(C) 2025 John F. Ehlers
}

inputs:
	Period0( 20 );

variables:
	SS( 0 ),
	Period( 20 ),
	ROC1( 0 ),
	ROCRMS( 0 ),
	ROC( 0 );

SS = $SuperSmoother( Close, Period );
ROC1 = SS - SS[1];
ROCRMS = $RMS( ROC1, 81 );

if ROCRMS <> 0 then
	ROC = AbsValue( ROC1 / ROCRMS );

if ROC > 2 then
	ROC = 2;

Period = Period0 * (1 - (0.5 * ROC)) * (1 - (0.5 * ROC));

if Period < 2 then
	Period = 2;

Plot1( $SuperSmoother( Close, Period0 ) );
Plot2( SS );

Function: $RMS

{
	$RMS Function
	(C) 2025 John F. Ehlers
}

inputs:
	Price( numericseries ),
	Length( numericsimple );

variable:
	SumSq( 0 ),
	Count( 0 );

SumSq = 0;

for Count = 0 to Length - 1
begin
	SumSq = SumSq + Price[count]*Price[count];
end;

if SumSq <> 0 then 
	$RMS = SquareRoot(SumSq / Length);
 
Function: $SuperSmoother

{
	$SuperSmoother Function
	(C) 2025 John F. Ehlers
}
inputs:
	Price( numericseries ),
	Period( numericsimple );

variables:
	A0( 0 ),
	Q( 0 ),
	C1( 0 ),
	C2( 0 );
	
Q = ExpValue( -1.414*3.14159 / Period );
C1 = 2 * Q * Cosine(1.414*180 / Period);
C2 = Q*Q;
A0 = (1 - c1 + c2) / 2;

if CurrentBar >= 4 Then $SuperSmoother = A0*( Price +
 Price[1]) + C1 * $SuperSmoother[1] - C2 * $SuperSmoother[2];

if Currentbar < 4 then 
	$SuperSmoother = Price;
	
All files in topic