Indicator & Trading Strategy – The Stiffness Indicator

Forums ProRealTime English forum ProBuilder support Indicator & Trading Strategy – The Stiffness Indicator

Viewing 5 posts - 1 through 5 (of 5 total)
  • #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 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 ) ; 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 ;

    #85129

    Not 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/

    #85132

    Hi 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

    #85273

    When I read the S&C issue this month, I immediately thought of the indicator Vonasi has made some weeks ago.. 😆

    #180576

    There you go https://www.prorealcode.com/prorealtime-indicators/stiffness-indicator/

     

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login