Weis Wave Volume
Author: sedelstein
Creation Date: 4/9/2019 5:25 PM
profile picture

sedelstein

#1
Haven't found code for this but has anyone tried this indicator in WL?

https://www.tradingview.com/script/QrCFs0K2-Weis-Wave-Volume/
profile picture

Eugene

#2
I put it on my TODO list of things for later.
profile picture

sedelstein

#3
Great. Thank you.
profile picture

Eugene

#4
Here it goes:

CODE:
Please log in to see this code.


At the moment I'm not sure if it's worth including it in Community Indicators, though.
profile picture

sedelstein

#5
Thanks. Will give this a look right away and happy to share insights (if any ;->)
profile picture

Eugene

#6
You're welcome. Note that I used different language versions for the translation rather than the one in your link:

https://usethinkscript.com/d/72-weis-wave-volume-indicator-for-thinkorswim
https://www.prorealcode.com/prorealtime-indicators/weis-wave-volume/
profile picture

superticker

#7
Appreciate the code solution above is design for readability, not efficiency. If garbage collector and cache-hit efficiency are a concern (for a production version), then mov, wave, and trend can be declared as integer (or even Boolean) arrays of two elements.
CODE:
Please log in to see this code.

And the modulo 2 divide would be better executed as an AND mask instead (since it's a power of 2), but that might be too cryptic for non-coders.

If you employ Boolean arrays (instead to integer arrays), then you can simply write the solution as Boolean equations, which would be fastest for the processor, although the understandability of it for this audience might suffer. Perhaps the integer implementation can be included as comments.
profile picture

Eugene

#8
@superticker

Appreciate your comment Mark. Indeed I choose to make the "mov" etc. a DataSeries for readability. The resulting code with arrays would be less manageable and/or intuitive as you point out. The tradeoff to this approach is a slightly higher memory footprint. If this becomes a concern the user can call Bars.Cache.Clear at the end of the Strategy to help free resources if his simulation consumes large amounts of data (e.g. intraday). Otherwise he shouldn't notice any practical impact.
profile picture

superticker

#9
QUOTE:
Indeed I choose to make the "mov" etc. a DataSeries for readability. The resulting code with arrays would be less manageable and/or intuitive as you point out.
I think the most instructive approach is the use a Rosetta Stone presentation. Recall scholars never understood Egyptian hieroglyphs until the discovery of the Rosetta Stone, which contained parallel translations to Greek. That cracked the Egyptian code.

So in a production version, I would include the Boolean equation implementation, but--in parallel--I would include the original long winded code as comments. Those motivated will study both "translations" and make parallels between them--and that's how we learned from the Rosetta Stone.

Also, the Boolean equations--which reduce the meaning into simplest terms--may reveal relationships we would not otherwise realize from the more verbose translation, which could be interesting.
profile picture

Eugene

#10
@sedelstein

Steve, have you had a chance to run the code and make sure it works as you expected?
profile picture

Eugene

#11
@sedelstein

fyi, Weis Wave Volume indicator is now part of Community Indicators v2019.06
profile picture

sedelstein

#12
Eugene

Sorry I missed your post #13. Not sure how it escaped notice.
Thanks for the help
profile picture

Eugene

#13
Steve,

You're welcome.
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).