TradingView
puttoAZ
25 авг 2022 г., 11:57

HPI for crypto [ptt] 

Ravencoin / TetherUSBinance

Описание

The Herrick Payoff Index is designed to show the amount of money flowing into or out of a futures contract.
This indicator uses open interest (from Binance PERP like this BTCUSDTPERP_OI) from during its calculations, therefore, the pairs being analyzed must contain open interest data on Binance.
The indicator only works with USDT pairs! Like RVNUSDT, BTCUSDT... does not work with USD pairs!

The indicator works in two mode.
Index mode - when the values moving 0-100
In this case, if the value below 10, it shows the money is flowing out of the futures contract and near the local bottom. If the value above 90, it shows the money is flowing into the futures contract and near the local top.
(The two trigger can be modified, the default is low:10 and high:90)

Oscillator mode - when the values moving around the origo (0)
In this case, if the value above 0 (green), it shows the money is flowing into the futures contract, this is bullish
If the value below 0 (red), it shows the money is flowing out of the futures contract, this is bearish

Информация о релизе

Some changes:
add: light and dark theme optionally
add: HPI index lookup length to the settings
add: working with PERP pairs too, like this ETCPERP

Информация о релизе

*add: 2 lookup length, one in DWM (daily or larger), one in intraday
*change: set the default wma length to 30
*change: symbol using

Информация о релизе

*add: Divergence signals by @wuhuoyan, thank you!
The divergence signals can show the regular bull/bear divergence and hidden bull/bear divergence.
*add: Volume bars to the HPI index view, which is green if the HPI value greater than 0 (bullish move) and red if less than 0 (bearish move)
Комментарии
puttoAZ
So.. this is an example for trading (CRVUSDT):

The trend was increasing (blue arrow on the price chart..) and the HPI (OI) peaks is reach the top (1. and 2. peak), but the last (3.) was much lower (~60HPI), so this was the signal that indicated that the trend would break!
If the price is increasing and the HPI increasing too or the HPI reach the top again, the trend is strong. But, once the HPI is broken, or not reach the top, the trend will be break...
This is also true in the opposite direction, if the price is decreasing...
puttoAZ


So the latest addons, show the volume on the HPI index view. This is green bars if the HPI > 0 and red if the HPI < 0. This show when the price is in bull session. If it is irritating you, just switch off this layer.
puttoAZ
I welcome all constructive comments and requests...
Moda-877
Could you make the alerts an alert condition so we would be alerted whenever there is a bull/bear, hidden bull/bear? Thanks, so we'll just add one alert
Future8Gaia
This is very nice work, thank you
wuhuoyan
The best indicator, I included divergence in the code
puttoAZ
@wuhuoyan, Thank you! :)
Please send me in direct message what addition/extension you did with the divergence..
Rajan7227
Hey on the new update did you change any value like length or something?
puttoAZ
@Rajan7227,
Hi, yes, and I wrote for the update:
Release Notes: *add: 2 lookup length, one in DWM (daily or larger), one in intraday
*change: set the default wma length to 30
*change: symbol using

So, the original HPI wma length was 21, and I changed to 30, but you can set to back in the settings.
And the HPI index lookup length modified to 50 (this is the daily, weekly, monthly), it was 100.
TheSecretsOfTrading
Thanks for sharing, a little suggestion:
root = str.upper(syminfo.ticker)
if not str.contains(root, 'PERP')
root = str.tostring(root)+"PERP_OI"

this way you can use it on all instruments, without the need to check only PERP.
Ещё