Threshold( 90 ) ;
variables:
MAValue( 0 ), MACorValue( 0 ), NumAboveMA( 0 ), Stiffness( 0 ), StiffnessEMA( 0 ) ;
MAValue = Average( Close, MALength ) ; MACorValue = MAValue – .2 *
StdDev( Close, MALength ) ; NumAboveMA = CountIf( Close >
MACorValue, StiffnessLength ) ; Stiffness = NumAboveMA *
MALength / StiffnessLength ; StiffnessEMA = XAverage( Stiffness, 3 ) ;
Plot1( Threshold, “Threshold” ) ; Plot2( StiffnessEMA, “Stiffness” ) ;
Indicator: Corrected Moving Average// The Stiffness Indicator
// Markos Katsanos
// TASC Nov 2018
inputs:
MALength( 100 ), StiffnessLength( 60 ), Threshold( 90 ) ;
variables:
MAValue( 0 ), MACorValue( 0 ), NumAboveMA( 0 ), Stiffness( 0 ), StiffnessEMA( 0 ) ;
MAValue = Average( Close, MALength ) ; MACorValue = MAValue – .2 *
StdDev( Close, MALength ) ;
Plot1( MACorValue, “MA COR” ) ; Plot2( MAValue, “MA” ) ;
Strategy: Stiffness Strategy// The Stiffness Indicator
// Markos Katsanos
// TASC Nov 2018
// Requires Data2 Symbol for Market //
inputs:
MALength( 100 ), StiffnessLength( 60 ), BuyThreshold( 90 ), SellThreshold( 50 ), ExitAfterBars( 84 ), MarketTrendEMALength( 100 ) ;
variables:
MAValue( 0 ),
MACorValue( 0 ), NumAboveMA( 0 ),
Stiffness( 0 ),
StiffnessEMA( 0 ), MarketTrendAvg( 0, Data2 ), MarketTrendOK( false, Data2 ) ;
MAValue = Average( Close, MALength ) ; MACorValue = MAValue – .2 *
StdDev( Close, MALength ) ; NumAboveMA = CountIf( Close >
MACorValue, StiffnessLength ) ; Stiffness = NumAboveMA *
MALength / StiffnessLength ; StiffnessEMA = XAverage( Stiffness, 3 ) ;
MarketTrendAvg = XAverage( Close of Data2, MarketTrendEMALength ) of Data2 ;
MarketTrendOK = MarketTrendAvg >= MarketTrendAvg[2] ;
if StiffnessEMA crosses over BuyThreshold and MarketTrendOK then
Buy ( “X Over LE” ) next bar at Market ;
if StiffnessEMA crosses under SellThreshold then Sell ( “X Under LX” ) next bar at Market ;
if BarsSinceEntry >= ExitAfterBars then
Sell ( “Num Days LX” ) next bar at Market ;