Syntax
public DSS(Bars bars, int period1, int period2, int stochP, string description)
public static DSS Series(Bars bars, int period1, int period2, int stochP)
Parameter Description
period1 |
1st Exponential Moving Average period |
period2 |
2nd Exponential Moving Average period |
stochP |
Stochastic %K period |
Description
The Double Smoothed Stochastic indicator was created by William Blau. It applies Exponential Moving Averages (
EMAs) of two different periods to a standard Stochastic %K,
StochK. The components that construct the Stochastic Oscillator are first smoothed with the two
EMAs. Then, the smoothed components are plugged into the standard Stochastic formula to calculate the indicator.
Interpretation
DSS ranges from 0 to 100, like the standard Stochastic Oscillator. The same rules of interpretation that you use for Stochastics can be applied to DSS, although DSS offers a much smoother curve than the raw Stochastic.
Calculation
DSS = ( C-L
1 / H-L
1 ) * 100
where,
HH = Highest High in Lookback period
LL = Lowest Low in Lookback period
C-L = Close minus LL
H-L = HH minus LL
C-L
2 = EMA( C-L,
period2 )
H-L
2 = EMA( H-L,
period2 )
C-L
1 = EMA( C-L
2,
period1 )
H-L
1 + EMA( H-L
2,
period1 )
Example
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
// Buy when DSS turns up from an oversold level
DataSeries dss = DSS.Series( Bars, 10, 20, 5 );
ChartPane DSSPane = CreatePane( 50, true, true );
PlotSeries( DSSPane, dss, Color.Crimson, LineStyle.Solid, 2 );
// DSS is considered "unstable" due to the inner use of EMA
for(int bar = 60; bar < Bars.Count; bar++)
{
if (!IsLastPositionActive)
{
if( ( TurnUp( bar, dss ) ) & ( dssbar-1 < 24 ) )
BuyAtMarket( bar+1, "DSS" );
}
else
{
if( TurnDown( bar, dss ) )
SellAtMarket( bar+1, LastPosition, "DSS" );
}
}
}
}
}