Coding Bressert DSS
Author: FishFlip_MVP
Creation Date: 6/20/2017 5:52 AM
profile picture

FishFlip_MVP

#1
Hi, im having trouble coding this indicator.

I've attached an image of the formula im trying to replicate but my code doesnt seem to be working, i think its to do with the last step involving the EMA.



CODE:
Please log in to see this code.


*Edit was adding Image into post

*Edit // Eugene: fixed image link
profile picture

Eugene

#2
Hi,

It's more simple than you think.

1) First, there's an indicator described as very close to Bressert DSS - called Irwin Cycle.
2) The "X" is simply EMA-smoothed DSS indicator (built into WLD). It boils down to this:
CODE:
Please log in to see this code.

3) Unfortunately, there's no shortcut for Bressert DSS (the "b") and but coding the rest is a one-liner too since it's EMA-smoothed Stochastic again.

Let me know if this matches the trading platform you're comparing against and the proper "r" and "n" lookback periods and I'll include the indicator in Commuity.Indicators for its July 2017 release.

CODE:
Please log in to see this code.


P.S. On a related note, avoid calling .Value in a loop in your strategies. It's going to be much faster if you call the .Series method instead:
CODE:
Please log in to see this code.
profile picture

FishFlip_MVP

#3
Eugene, thankyou for your response and code sample, its a great help and indicator seems to be right.
profile picture

Eugene

#4
Glad to help. For inclusion in C.Indicators I'll go with EMA(8) and Stochastic(13), OB(80) + OS(20) as the default settings.
profile picture

Eugene

#5
Bressert DSS included in C.Indicators 2017.07. Please update the extension and restart WL.
profile picture

Darrell__

#6
The Community Bressert DSS indicator is using the following code to calculate X:
CODE:
Please log in to see this code.

However, are the periodEMA and periodStochastic parameters reversed? Shouldn't the code be:
CODE:
Please log in to see this code.


profile picture

Eugene

#7
What a pity. I think I made an error refactoring the "r" and "n" into human readable labels in Visual Studio. :(

This is a tricky situation. We had a similar bug in a Stochastic in WL5 days. If I switch the order of labels now then the performance of anybody's system powered with BressertDSS should be affected (unless the periods were equal of course). For this reason, instead of making the breaking change I decide to reflect and highlight this glitch in the online guide for now:

Wealth-Lab Wiki > BressertDSS

Thanks again Darrell. You've been very helpful spotting errors in our indicators.
profile picture

superticker

#8
QUOTE:
If I switch the order of labels now then the performance of anybody's system powered with BressertDSS should be affected
I would not switch the physical parameter order (relative to actual function), but I would switch the parameter names so new users aren't confused by the names not being right as they are now. In other words, update the documentation but don't change any of the class code (other than changing the internal semantics around).

CODE:
Please log in to see this code.
... without changing the implimentation.

This way the documented parameter names correspond correctly and any existing strategies remain unaffected (although users might want to update the semantics in their strategy code).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).