Traders Tips from TASC

Questions about MultiCharts and user contributed studies. canaussieuck
Posts: 25
Joined: 13 Mar 2012
Has thanked: 2 times

Traders Tips from TASC

Can you reproduce this EL Code to use in MultiCharts please?

Code: Select all

_TEMA (Function - set Return Type to double)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }

inputs:
Price( numericseries ), { value to average }
Length( numericsimple ) ; { length of average }

variables:
EMA1( 0 ),
EMA2( 0 ),
EMA3( 0 ) ;

EMA1 = XAverage( Price, Length ) ;
EMA2 = XAverage( EMA1, Length ) ;
EMA3 = XAverage( EMA2, Length ) ;

_TEMA = 3 * EMA1 - 3 * EMA2 + EMA3 ;

_SZO (Indicator)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }
{ Walid Khalil, MFTA, CFTe }

inputs:
Period( 14 ),
LongPeriod( 30 ),
OverBought( 7 ),
OverSold( -7 ),
PlotZeroLine( true ),
PlotDynamicOBandOS( true ) ;

variables:
R( 0 ),
SP( 0 ),
SZO( 0 ),
HighestSZO( 0 ),
LowestSZO( 0 ),
SZORange( 0 ),
DynamicOB( 0 ),
DynamicOS( 0 ) ;

if Close > Close then
R = 1
else
R = -1 ;

SP = _TEMA( R, Period ) ;
SZO = 100 * SP / Period ;

HighestSZO = Highest( SZO, LongPeriod ) ;
LowestSZO = Lowest( SZO, LongPeriod ) ;
SZORange = HighestSZO - LowestSZO ;

DynamicOB = LowestSZO + SZORange * 0.95 ;
DynamicOS = HighestSZO - SZORange * 0.95 ;

Plot1( SZO, "SZO" ) ;
if PlotZeroLine then
Plot2( 0, "Zero" ) ;
Plot3( OverBought, "OB" ) ;
Plot4( OverSold, "OS" ) ;
if PlotDynamicOBandOS then
begin
Plot5( DynamicOB, "DynOB" ) ;
Plot6( DynamicOS, "DynOS" ) ;
end ;

begin
if SZO crosses above OverSold then
Alert( "SZO cross above OS" )
else if SZO crosses above DynamicOS then
Alert( "SZO cross above DynamicOS" )
else if SZO crosses below OverBought then
Alert( "SZO cross below OB" )
else if SZO crosses below DynamicOB then
Alert( "SZO cross below DynamicOB" ) ;
end ;

_SZO_Strategy (Strategy)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }
{ Walid Khalil, MFTA, CFTe }

inputs:
SZOPeriod( 14 ), { length for SZO calculations }
LongPeriod( 30 ), { used for dynamic OB and OS
levels }
SZOAvgLen( 30 ), { moving average length of SZO -
for entry/exit }
TrendEMALen( 60 ), { length for trend EMA }
OverBought( 7 ),
OverSold( -7 ) ;

variables:
R( 0 ),
SP( 0 ),
SZO( 0 ),
SZO_SMA( 0 ),
TrendEMA( 0 ),
HighestSZO( 0 ),
LowestSZO( 0 ),
SZORange( 0 ),
DynamicOB( 0 ),
DynamicOS( 0 ),
SellCondition1( false ),
SellCondition2( false ) ;

if Close > Close then
R = 1
else
R = -1 ;

SP = _TEMA( R, SZOPeriod ) ;
SZO = 100 * SP / SZOPeriod ;
TrendEMA = XAverage( Close, TrendEMALen ) ;
SZO_SMA = Average( SZO, SZOAvgLen ) ;

HighestSZO = Highest( SZO, LongPeriod ) ;
LowestSZO = Lowest( SZO, LongPeriod ) ;
SZORange = HighestSZO - LowestSZO ;

DynamicOB = LowestSZO + SZORange * 0.95 ;
DynamicOS = HighestSZO - SZORange * 0.95 ;

{ Buy Rules/Conditions }
BuyCondition1 = SZO_SMA crosses above 0 and
Close > TrendEMA ;
BuyCondition2 = Close > TrendEMA and
SZO_SMA > SZO_SMA and SZO < DynamicOS ;
BuyCondition3 = SZO_SMA > 0 and SZO crosses above
DynamicOS and TrendEMA > TrendEMA ;

{ Sell Rules/Conditions }
SellCondition1 = SZO_SMA crosses above 0 ;
SellCondition2 = SZO crosses below OverBought and
SZO_SMA < SZO_SMA ;

{ Long Entry }
Buy ( "SZO LE" ) next bar market ;

{ Long Exit }
if SellCondition1 or SellCondition2 then
Sell ( "SZO LX" )

TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times

Re: Traders Tips from TASC

Can you reproduce this EL Code to use in MultiCharts please?
You have more than one code in the post.
I have separated them for you; they should run in MultiCharts with no problem.

Code: Select all

// _TEMA (Function - set Return Type to double)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }

inputs:
Price( numericseries ), { value to average }
Length( numericsimple ) ; { length of average }

variables:
EMA1( 0 ),
EMA2( 0 ),
EMA3( 0 ) ;

EMA1 = XAverage( Price, Length ) ;
EMA2 = XAverage( EMA1, Length ) ;
EMA3 = XAverage( EMA2, Length ) ;

_TEMA = 3 * EMA1 - 3 * EMA2 + EMA3 ;

Code: Select all

// _SZO (Indicator)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }
{ Walid Khalil, MFTA, CFTe }

inputs:
Period( 14 ),
LongPeriod( 30 ),
OverBought( 7 ),
OverSold( -7 ),
PlotZeroLine( true ),
PlotDynamicOBandOS( true ) ;

variables:
R( 0 ),
SP( 0 ),
SZO( 0 ),
HighestSZO( 0 ),
LowestSZO( 0 ),
SZORange( 0 ),
DynamicOB( 0 ),
DynamicOS( 0 ) ;

if Close > Close then
R = 1
else
R = -1 ;

SP = _TEMA( R, Period ) ;
SZO = 100 * SP / Period ;

HighestSZO = Highest( SZO, LongPeriod ) ;
LowestSZO = Lowest( SZO, LongPeriod ) ;
SZORange = HighestSZO - LowestSZO ;

DynamicOB = LowestSZO + SZORange * 0.95 ;
DynamicOS = HighestSZO - SZORange * 0.95 ;

Plot1( SZO, "SZO" ) ;
if PlotZeroLine then
Plot2( 0, "Zero" ) ;
Plot3( OverBought, "OB" ) ;
Plot4( OverSold, "OS" ) ;
if PlotDynamicOBandOS then
begin
Plot5( DynamicOB, "DynOB" ) ;
Plot6( DynamicOS, "DynOS" ) ;
end ;

begin
if SZO crosses above OverSold then
Alert( "SZO cross above OS" )
else if SZO crosses above DynamicOS then
Alert( "SZO cross above DynamicOS" )
else if SZO crosses below OverBought then
Alert( "SZO cross below OB" )
else if SZO crosses below DynamicOB then
Alert( "SZO cross below DynamicOB" ) ;
end ;

Code: Select all

// _SZO_Strategy (Strategy)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }
{ Walid Khalil, MFTA, CFTe }

inputs:
SZOPeriod( 14 ), { length for SZO calculations }
LongPeriod( 30 ), { used for dynamic OB and OS
levels }
SZOAvgLen( 30 ), { moving average length of SZO -
for entry/exit }
TrendEMALen( 60 ), { length for trend EMA }
OverBought( 7 ),
OverSold( -7 ) ;

variables:
R( 0 ),
SP( 0 ),
SZO( 0 ),
SZO_SMA( 0 ),
TrendEMA( 0 ),
HighestSZO( 0 ),
LowestSZO( 0 ),
SZORange( 0 ),
DynamicOB( 0 ),
DynamicOS( 0 ),
SellCondition1( false ),
SellCondition2( false ) ;

if Close > Close then
R = 1
else
R = -1 ;

SP = _TEMA( R, SZOPeriod ) ;
SZO = 100 * SP / SZOPeriod ;
TrendEMA = XAverage( Close, TrendEMALen ) ;
SZO_SMA = Average( SZO, SZOAvgLen ) ;

HighestSZO = Highest( SZO, LongPeriod ) ;
LowestSZO = Lowest( SZO, LongPeriod ) ;
SZORange = HighestSZO - LowestSZO ;

DynamicOB = LowestSZO + SZORange * 0.95 ;
DynamicOS = HighestSZO - SZORange * 0.95 ;

{ Buy Rules/Conditions }
BuyCondition1 = SZO_SMA crosses above 0 and
Close > TrendEMA ;
BuyCondition2 = Close > TrendEMA and
SZO_SMA > SZO_SMA and SZO < DynamicOS ;
BuyCondition3 = SZO_SMA > 0 and SZO crosses above
DynamicOS and TrendEMA > TrendEMA ;

{ Sell Rules/Conditions }
SellCondition1 = SZO_SMA crosses above 0 ;
SellCondition2 = SZO crosses below OverBought and
SZO_SMA < SZO_SMA ;

{ Long Entry }
Buy ( "SZO LE" ) next bar market ;

{ Long Exit }
if SellCondition1 or SellCondition2 then
Sell ( "SZO LX" ) canaussieuck
Posts: 25
Joined: 13 Mar 2012
Has thanked: 2 times

Re: Traders Tips from TASC

Thanks TJ, i should have looked closer.

CanOZ canaussieuck
Posts: 25
Joined: 13 Mar 2012
Has thanked: 2 times

Re: Traders Tips from TASC

Did you try to compile it? It doesn't like _TEMA, say "unknown Function".

CanOz Posts: 710
Joined: 09 Apr 2010
Has thanked: 468 times
Been thanked: 261 times
Contact:

Re: Traders Tips from TASC

Did you try to compile it? It doesn't like _TEMA, say "unknown Function".

CanOz
***************************************************************
That's because you have to "Create" and "Verify" the "_Tema" Function first.

Code: Select all

// _TEMA (Function - set Return Type to double)

{ TASC May 2012 }
{ Sentiment Zone Oscillator }

inputs:
Price( numericseries ), { value to average }
Length( numericsimple ) ; { length of average }

variables:
EMA1( 0 ),
EMA2( 0 ),
EMA3( 0 ) ;

EMA1 = XAverage( Price, Length ) ;
EMA2 = XAverage( EMA1, Length ) ;
EMA3 = XAverage( EMA2, Length ) ;

_TEMA = 3 * EMA1 - 3 * EMA2 + EMA3 ; SP
Posts: 455
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 283 times

Re: Traders Tips from TASC

Eld from the TS Forum.
Attachments
TASC 052112 SZO.ELD 