Methods of Calculation
1. Price Change Per
The main method this indicator uses to reveal market sentiment is by comparing price change to the of trades in a bar.
You will see this calculation plotted in its most basic form by ticking the "Show Bar per Bar Change/Volume" box in the inputs dialog. I personally found that the plots were too noisy and cannot be used in real time reliably due to the fact that there is not much at the open of a new bar. I decided to leave in the option to use this method, in case you'd like to experiment with it or get a better grasp of how the indicator works.
2. Exponential Moving Averages
In my quest to smooth out the plotted data, I experimented with exponential moving averages. Applying an on the change per data did smooth it out a bit, but still left in a lot of noise. So I worked around it by applying the to the price change first, and then dividing it by the of the . The term I use for the result of this calculation is "Market Sentiment" (do let me know if you have a better-fitting term for it ;-)), and I have kept it as an option that you can use in the way you would use other oscillators like CMF , OBV, etc. This option is unticked by default.
I left "Market Sentiment" unchecked as the default option because I thought an easier way to use this indicator would be as a like the . So that's what I turned it into! I applied another on the Market Sentiment, added a slower to subtract from the first, and now we have a line. I added a signal line to subtract from the , and the result is plotted as a histogram... ish . I used area instead of columns for plot style so you don't get confused when comparing with a regular indicator, but you can always change it if an actual histogram is more your taste.
The "histogram" is the main gauge of sentiment change momentum and it is easiest to use, that is why it is the only calculation plotted by default.
Methods of Use
As I have mentioned before, you can use this as you would other oscillators.
-The easiest way to use this indicator is with the Momentum histogram, where crosses over 0 indicate increasing sentiment, and crosses below 0 indicate increasing sentiment. You may also spot occasional divergences with the histogram.
-For the Market Sentiment option, the easiest way to use it is to look for divergences.
-And if you use the "Price Change per of Each Bar", well... I honestly don't know. I guess divergences would be apparent towards the close of a bar, but in realtime, I don't recommend you use this. Maybe if you'd like to study the market movement, looking at historical data and comparing price, , and Change per of each bar would come in handy in a pseudo-tape-reading kind of way.
Anyway, that's my explanation of this indicator. The default values were tested on BTC /USDT (Binance) 4h with decent results. You'll have to adjust the parameters for different markets and timeframes.
I have published this as a strategy so you can test out how the indicator performs as you're tweaking the parameters.
I'm aware that the code might not be the cleanest as I have only started learning pine (and code in general) for about a month, so any suggestions to improve the script would be appreciated!
Good luck and happy trading :-)
Với tinh thần của TradingView, tác giả đã xuất bản tập lệnh theo mã nguồn mở, vì thế trader có thể dễ dàng hiểu và tùy chỉnh được. Bạn có thể sử dụng miễn phí, hoặc tùy chỉnh lại mã đã được cấp phép bởi Quy tắc Chung. Bạn có thể sử dụng nó trên biểu đồ.