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.
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.
Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. You can favorite it to use it on a chart.