spacetrader

OBV Accumulation / Distribution combination v2

OBV takes difference between old close and new close and multiplies by volume without considering high and low.
This assigns the entire volume into a single direction even tho movement could've been in both.


Accum/dist takes difference between close and high and low without considering previous close or open. This causes huge deviation from OBV when you have close or open far from high or low and price moving in the other direction like in a series of descending hammers.


This is attempt to combine both so relative motion between candles is detected and volume direction is assigned based relative to movement within a candle to account for volume in both directions.

+ and - depends if close is above previous close (+ if above, - if below)

Maximum upward volume counts if close = high and previous close = low, this makes multiplier 1 and thus entire volume is counted upwards

Maximum downward volume counts if close = low and previous close = high, this makes multiplier -1 and thus entire volume is counted downwards.

Zero volume movement occurs when close = previous close.

Half upward volume movement occurs if close-previous_close is half the range from high-low.

Update:

Open used instead of previous close due to issues with grabbing previous close on some charts. This seems more accurate for gaps without volume.
Скрипт с открытым кодом

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

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

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

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