Indicator Not Working

Questions about MultiCharts and user contributed studies.
syracusepro
Posts: 17
Joined: 29 Sep 2016

Indicator Not Working

Postby syracusepro » 30 Sep 2016

Hi; On the following code, the function compiles fine, but the indicator does not.

Code: Select all

Function: SRSI

// TASC JUL 2015
// SRSI

inputs:
iPrice( numericseries ),
Length( numericsimple ),{ this input assumed to be a constant >= 1 }
SMoothingLength( numericsimple ) ;

variables:
NetChgAvg( 0 ),
TotChgAvg( 0 ),
Change( 0 ),
SF( 1 / Length ), { smoothing factor }
ChgRatio( 0 ),
Price( 0 ) ;

Price = XAverage( iPrice, SMoothingLength ) ;

if CurrentBar = 1 then
begin
NetChgAvg = ( Price - Price[Length] ) / Length ;
TotChgAvg = Average( AbsValue( Price - Price[1] ), Length ) ;
end
else
begin
Change = Price - Price[1] ;
NetChgAvg = NetChgAvg[1] + SF * ( Change - NetChgAvg[1] ) ;
TotChgAvg = TotChgAvg[1] + SF * ( AbsValue( Change ) - TotChgAvg[1] ) ;
end ;

if TotChgAvg <> 0 then
ChgRatio = NetChgAvg / TotChgAvg
else
ChgRatio = 0 ;

SRSI = 50 * ( ChgRatio + 1 ) ;

Code: Select all


Indicator: SRSI

// TASC JUL 2015
// SRSI

inputs:
iPrice( numericseries ),
Length( numericsimple ),{ this input assumed to be a constant >= 1 }
SMoothingLength( numericsimple ) ;

variables:
NetChgAvg( 0 ),
TotChgAvg( 0 ),
Change( 0 ),
SF( 1 / Length ), { smoothing factor }
ChgRatio( 0 ),
Price( 0 ) ;

Price = XAverage( iPrice, SMoothingLength ) ;

if CurrentBar = 1 then
begin
NetChgAvg = ( Price - Price[Length] ) / Length ;
TotChgAvg = Average( AbsValue( Price - Price[1] ), Length ) ;
end
else
begin
Change = Price - Price[1] ;
NetChgAvg = NetChgAvg[1] + SF * ( Change - NetChgAvg[1] ) ;
TotChgAvg = TotChgAvg[1] + SF * ( AbsValue( Change ) - TotChgAvg[1] ) ;
end ;

if TotChgAvg <> 0 then
ChgRatio = NetChgAvg / TotChgAvg
else
ChgRatio = 0 ;

SRSI = 50 * ( ChgRatio + 1 ) ;

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Indicator Not Working

Postby TJ » 30 Sep 2016

Hi; On the following code, the function compiles fine, but the indicator does not.
::

See post #2
viewtopic.php?f=1&t=50143

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Indicator Not Working

Postby bensat » 30 Sep 2016

This is/was a mistake by TRADERS. They copied only the function for the indicator twice. The function compiles.
To download the EasyLanguage code, please visit our TS and EasyLanguage support forum. The code from this article can be found at http://www.TS.com/TASC-2015. The ELD filename is “TASC_JUL2015.ELD.”
Kind Regards

Ben

syracusepro
Posts: 17
Joined: 29 Sep 2016

Re: Indicator Not Working

Postby syracusepro » 30 Sep 2016

Do Multicharts customers have access to TS studies page?


Return to “MultiCharts”