How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

# DSS Bressert (Double Smoothed Stochastic)

3853 19
Hi
Let me introduce my DSS Bressert ( Double Smoothed Stochastic ) script.
Double Smoothed Stochastics (DSS) is designed by William Blaw.
It attempts to combine moving average methods with oscillator principles.
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 24/04/2014
// Double Smoothed Stochastics (DSS) is designed by William Blaw.
// It attempts to combine moving average methods with oscillator principles.
////////////////////////////////////////////////////////////
study(title="DSS Bressert (Double Smoothed Stochastic)", shorttitle="DSS Bressert")
PDS = input(10, minval=1)
EMAlen = input(9, minval=1)
TriggerLen = input(5, minval=1)
Overbought = input(80, minval=1)
Oversold = input(20, minval=1)
hline(Overbought, color=green, linestyle=line)
hline(Oversold, color=red, linestyle=line)
xPreCalc = ema(stoch(close, high, low, PDS), EMAlen)
xDSS = ema(stoch(xPreCalc, xPreCalc, xPreCalc, PDS), EMAlen)
//xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
xTrigger = ema(xDSS, TriggerLen)
plot(xDSS, color=blue, title="DSS")
plot(xTrigger, color=red, title="Trigger")
Love it!
How would one plot a PDS = 5 on the same chart? Thanks
SetagayaGirl
@SetagayaGirl, If I understand you correctly. Just do comment line 19
HPotter
@HPotter, Yes, I'd like to remove the trigger line, but I'd like to see a DSS for both 5 & 10 PDS on the same chart. Thanks
SetagayaGirl
@SetagayaGirl,

For this you should change script. Should add lines:
---------
xPreCalc5 = ema(stoch(close, high, low, 5), EMAlen)
xDSS5 = ema(stoch(xPreCalc5, xPreCalc5, xPreCalc5, 5), EMAlen)
------
plot(xDSS5, color=blue, title="DSS-5")

For 10 PDS you should use defoult value from inputs.
HPotter
@HPotter, Thanks much. I'll let you know how it goes. :)
HPotter
@HPotter, I have failed, it seems. :( (Error: cannot compile script)

study(title="DSS Bressert (Double Smoothed Stochastic)", shorttitle="DSS Bressert")
PDS = input(10, minval=1)
EMAlen = input(9, minval=1)
TriggerLen = input(5, minval=1)
Overbought = input(80, minval=1)
Oversold = input(20, minval=1)
hline(Overbought, color=green, linestyle=line)
hline(Oversold, color=red, linestyle=line)
xPreCalc = ema(stoch(close, high, low, PDS), EMAlen)
xDSS = ema(stoch(xPreCalc, xPreCalc, xPreCalc, PDS), EMAlen)
xPreCalc5 = ema(stoch(close,high,low,5)EMAlen)
xDSS5 = ema(stoch(xPreCalc5,xPreCalc5,xPreCalc5,5), EMAlen)
//xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
//xTrigger = ema(xDSS, TriggerLen)
plot(xDSS, color=blue, title="DSS")
//plot(xTrigger, color=red, title="Trigger")
plot(xDSS5, color-white, title="DSS5")
SetagayaGirl
@SetagayaGirl uncomment this

//xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
HPotter
@HPotter, Thanks. I did that however, and still cannot compile.

study(title="DSS Bressert (Double Smoothed Stochastic)", shorttitle="DSS Bressert")
PDS = input(10, minval=1)
EMAlen = input(9, minval=1)
TriggerLen = input(5, minval=1)
Overbought = input(80, minval=1)
Oversold = input(20, minval=1)
hline(Overbought, color=green, linestyle=line)
hline(Oversold, color=red, linestyle=line)
xPreCalc = ema(stoch(close, high, low, PDS), EMAlen)
xDSS = ema(stoch(xPreCalc, xPreCalc, xPreCalc, PDS), EMAlen)
xPreCalc5 = ema(stoch(close,high,low,5)EMAlen)
xDSS5 = ema(stoch(xPreCalc5,xPreCalc5,xPreCalc5,5), EMAlen)
xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
//xTrigger = ema(xDSS, TriggerLen)
plot(xDSS, color=blue, title="DSS")
//plot(xTrigger, color=red, title="Trigger")
plot(xDSS5, color-white, title="DSS5")
SetagayaGirl
@SetagayaGirl, I think last line should be: color=white and not a color-white

HPotter
@HPotter, Ahah! You are so right. Can't believe I missed that. :)

However, after changing it ... same:

Script could not be translated from: )|E|
|B|xDSS5 = ema(stoch
SetagayaGirl
@SetagayaGirl, May be you are have a space before lines? You should delete all spaces in the leftside.
HPotter
@HPotter, No extra spaces on the left (you can see below from the copy). I have looked this over so carefully, but I cannot find the problem. :(

I don't know what |E||B| means as related to xDSS5 = ema(stoch

It seems that's the line where it's failing.

study(title="DSS Bressert (Double Smoothed Stochastic)", shorttitle="DSS Bressert")
PDS = input(10, minval=1)
EMAlen = input(9, minval=1)
TriggerLen = input(5, minval=1)
Overbought = input(80, minval=1)
Oversold = input(20, minval=1)
hline(Overbought, color=green, linestyle=line)
hline(Oversold, color=red, linestyle=line)
xPreCalc = ema(stoch(close, high, low, PDS), EMAlen)
xDSS = ema(stoch(xPreCalc,xPreCalc,xPreCalc, PDS), EMAlen)
xPreCalc5 = ema(stoch(close,high,low,5)EMAlen)
xDSS5 = ema(stoch(xPreCalc5,xPreCalc5,xPreCalc5, 5), EMAlen)
xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
//xTrigger = ema(xDSS, TriggerLen)
plot(xDSS, color=blue, title="DSS")
//plot(xTrigger, color=red, title="Trigger")
plot(xDSS5, color=white, title="DSS5")
SetagayaGirl
@SetagayaGirl,
xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS) - Should be commented, sorry I forgot it ))
xPreCalc5 = ema(stoch(close,high,low,5)EMAlen) - This should be "," before EMAlen
HPotter
@HPotter, Such a little thing, that comma. :)

It works now. Thank you very much for your patience!
SetagayaGirl
@SetagayaGirl, You are welcome.
HPotter
@HPotter, While this plots now, it doesn't quite give me what my old formula in Amibroker did. That is to say, the 5 period plots almost like a trigger line (not exactly of course) to the 10 period. In the original Bressert formula for Amibroker, there are times when there is tremendous separation between the two plots (sometimes one is very high and the other is very low).

This is the Amibroker formula I've been using for years. But I don't know how to translate it to pine script. Maybe you'd be interested in seeing how this compares?

Slw = 3;

Pds = 5;

sto = EMA((Close-LLV(Low,Pds))/(HHV(H,pds)-LLV(L,Pds)),Slw)*100;

DSS5 = EMA((sto-LLV(sto,pds))/(HHV(sto,Pds)-LLV(sto,Pds)),Slw)*100;

Plot(DSS5,"DSS5",2,1);

// 2,1 in the line above refer to color and line style

Pds = 10;

Sto = EMA((Close -LLV(Low,Pds))/(HHV(H,Pds)-LLV(L,Pds)),Slw)*100;

Dss10=EMA((Sto-LLV(Sto,pds))/(HHV(Sto,Pds)-LLV(Sto,Pds)),Slw)*100;

Plot(DSS10,"DSS10",colorRed,1);

In this formula, LLV is lowest low value of all lows in Pds, and HHV is the highest high in all highs of Pds.

If you could put this into Pine Script, you will be my hero.
SetagayaGirl
@SetagayaGirl, This is

(Close -LLV(Low,Pds))/(HHV(H,Pds)-LLV(L,Pds)

Formula stochastic what we are used.
We are have emalen = 9 as default. In this formula default 3. To try change it.
HPotter
@HPotter, Ah, I see now. Perfect! It's a match to the Amibroker plot now.

Again, thank you very much kind sir. :)
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter