Indicator & Trading Strategy – The Stiffness Indicator

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #85128 quote
    Mags67
    Participant
    Average

    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 quote
    Vonasi
    Moderator
    Master

    Not sure if this is the same ‘Stiffness Filter’ but it is something I coded a while back.

    Average Penetration Indicator

    #85132 quote
    Mags67
    Participant
    Average

    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 quote
    Nicolas
    Keymaster
    Master

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

    #180576 quote
    robertogozzi
    Moderator
    Master
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Indicator & Trading Strategy – The Stiffness Indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Mags67 @mags67 Participant
Summary

This topic contains 4 replies,
has 1 voice, and was last updated by robertogozzi
4 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/18/2018
Status: Active
Attachments: No files
Logo Logo
Loading...