latticephreak

On Balance Volume - Color Packed Patch'em

latticephreak 已更新   
OBV is provided as a built-in by TradingView.

This contribution grew out of reading about trend discovery, and since the library kept on this end was lacking in a volume-centric indicator, it looked like a good time to play around.

This approach isn't all that much different than many others with the possible exception of its color scheme.

Should you decide to use the script, it might be worth your while to work with the logic of color and line, to produce alerts.

Enjoy.

版本注释:
While the script is flawed, in the sense scaling does not employ an alpha, and the script, by consequence, does not work with all exchanges, or all symbols from an individual exchange, some improvements have been made.

Now you can set the Scale/Invert factor to reframe the context of calculations pertaining to volume relating to either high-close or close-low, fuchsia and lime lines, respectively.

To do this, simply change the sign before one or both of the scaling factors while leaving the factor in both cases the same. If you change only one sign, you invert the line in question and it intersects the other on the timeline. Changing the sign on both flips their positions, being mainly above or below their counterpart. Observing this, it's easy to see you can also jockey the lines using the MA length and different scaling factors. If you come up with an optimal setting, or fixes for problems you see, drop a comment, or send me a message, and I'll consider making changes to take the script down a better path.

Another feature, not remotely guaranteed to produce good results, results from breaking out enter and exit conditionals into more manageable functions which are better suited to encapsulating more complex conditionals. As stated, results can't be guaranteed here, mainly because the conditionals are not optimized.

And on that score, the conditionals now employed, while germane to producing alerts, are only loosely coupled to the setup of the analysis out of the box. Any changes you make to the settings before registering enter and/or exit alerts will be carried into how the alerts fire, and these new alert conditions are carried into alerts with the current code and settings, permanently, making use of the script with custom settings close to accurate only if you craft the settings and the conditionals together. You have to delete any alerts you've created, using your own naming convention for each alert as a guide as to which settings you've registered the alert to cover. It's a compromise of variations which does not resolve in the organization of the UX around the data flow to allow fine grained refactoring of alerts, or the conditionals they would cover; the api, as it stands does not allow it or 'recenter' it at that workflow juncture.

Still, it's all good. You've also got a zero point to use as a reference, directly relating to the core input for this indicator, volume.

I hope it serves all users' needs and brings each of you some enjoyment.

Happy coding and trading.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?