Indicator & Trading Strategy – The Stiffness Indicator
Forums › ProRealTime English forum › ProBuilder support › Indicator & Trading Strategy – The Stiffness Indicator
- This topic has 4 replies, 1 voice, and was last updated 2 years ago by robertogozzi.
-
-
11/18/2018 at 10:15 AM #85128
As quoted in Stocks&Commodities November issue, I’d like us all to be able to use the Stiffness Indicator in PRT-language as well. Here is the code for the indicator and the strategy in TradeStation-language and hopefully you are able to translate it to PRT. Thanks in advance!
Indicator: Stiffness Indicator// The Stiffness Indicator
// Markos Katsanos
// TASC Nov 2018inputs:
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 ) ; 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 2018inputs:
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 ;11/18/2018 at 10:52 AM #85129Not sure if this is the same ‘Stiffness Filter’ but it is something I coded a while back.
https://www.prorealcode.com/prorealtime-indicators/average-penetration-indicator/
11/18/2018 at 11:10 AM #85132Hi Vonasi!
Seems strange that S&C should have an article about the same code twice within the same year? Could be based on the same idea though! I’ll have a look at your code and see if it helps my question without further de-coding. Thanks!
/Mags
11/20/2018 at 9:29 AM #8527310/29/2021 at 9:13 PM #180576There you go https://www.prorealcode.com/prorealtime-indicators/stiffness-indicator/
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on