HPotter

DSS Bressert (Double Smoothed Stochastic)

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.
Remove from Favorite Scripts Add to Favorite Scripts
////////////////////////////////////////////////////////////
//  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")
Robbins2
3 months ago
Love it!
Reply
SetagayaGirl PRO
2 months ago
How would one plot a PDS = 5 on the same chart? Thanks
Reply
HPotter PRO SetagayaGirl
2 months ago
@SetagayaGirl, If I understand you correctly. Just do comment line 19
Reply
SetagayaGirl PRO HPotter
2 months ago
@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
Reply
HPotter PRO SetagayaGirl
2 months ago
@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.
Reply
SetagayaGirl PRO HPotter
2 months ago
@HPotter, Thanks much. I'll let you know how it goes. :)
Reply
SetagayaGirl PRO HPotter
2 months ago
@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")
Reply
HPotter PRO SetagayaGirl
2 months ago
@SetagayaGirl uncomment this

//xDSS = stoch(xPreCalc, xPreCalc, xPreCalc, PDS)
Reply
SetagayaGirl PRO HPotter
2 months ago
@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")
Reply
HPotter PRO SetagayaGirl
2 months ago
@SetagayaGirl, I think last line should be: color=white and not a color-white

Reply
SetagayaGirl PRO HPotter
2 months ago
@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
Reply
HPotter PRO SetagayaGirl
2 months ago
@SetagayaGirl, May be you are have a space before lines? You should delete all spaces in the leftside.
Reply
SetagayaGirl PRO HPotter
2 months ago
@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")
Reply
HPotter PRO SetagayaGirl
2 months ago
@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
Reply
SetagayaGirl PRO HPotter
2 months ago
@HPotter, Such a little thing, that comma. :)

It works now. Thank you very much for your patience!
Reply
HPotter PRO SetagayaGirl
2 months ago
@SetagayaGirl, You are welcome.
Reply
SetagayaGirl PRO HPotter
2 months ago
@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.
Reply
HPotter PRO SetagayaGirl
2 months ago
@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.
Reply
SetagayaGirl PRO HPotter
2 months ago
@HPotter, Ah, I see now. Perfect! It's a match to the Amibroker plot now.

Again, thank you very much kind sir. :)
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out