EmreKb

[EmreKb] Volume Analysis

I've noticed that many Pine coders calculate buy and sell volumes by considering the volume of a bullish candle as buy volume and the volume of a bearish candle as sell volume. However, I believe this approach isn't very logical, especially for candles with long wicks like pinbars.


Therefore, I've devised a method to calculate the buy and sell volumes of a candle by separately considering the sizes of its top and bottom wicks and its body. I distribute the volume of the candle equally among its top wick, body, and bottom wick sizes. If the candle is bearish, I consider the body volume as sell volume; if bullish, as buy volume. For the top and bottom wick volumes, since there's a two-way movement, I allocate half to buy volume and the other half to sell volume.

This indicator displays the sum of buy and sell volumes retrospectively up to the "lookback" value on the candle. You can set the lookback value to 1 to only visualize the buy and sell volume distribution of a single candle.

If this method has been used by another Pine coder, please inform me!
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?