TradingView
EltAlt
2022年6月8日上午9點41分

RSI vs Longs/Shorts Margin Ratio Percentage Rank 

SOL / DollarBitfinex

描述

This indicator plots the RSI of the current token and the percentage rank, of the RSI, of the ratio of a long margined token to a short margined token.

By default it plots the RSI of the current token with a color based on percentage rank the RSI of BITFINEX:BTCUSDLONGS divided by BITFINEX:BTCUSDSHORTS, so the assumption is that you are using it on a BTC chart. While you can select any Tradingview symbol for your Long and Short tokens I don't think you will get meaningful results unless you select a long and short margined token that matches your chart symbol, such as BITFINEX:ETHUSDLONGS and BITFINEX:ETHUSDSHORTS if you're trading ETHUSD. Even using margined tokens the results may not be meaningful, if there is not enough trade volume in the token, or if they are being manipulated, so you must backtest everything.

The three plot options are:
• Colored RSI - RSI plotted with colors based on the Longs/Shorts ratio
• Background Color - White RSI plot with Longs/Shorts ratio as background color
• RSI + Ratio - White RSI with Longs/Shorts ratio plotted in color
The chart shows all three options on an hourly BITFINEX:SOLUSD chart with BITFINEX:SOLUSDSHORTS and BITFINEX:SOLUSDLONGS.

By default it also plots a short term moving average and it can also plot the raw ratio rather than the percentage rank if selected.

This script started out as "RSI vs BITFINEX BTC Longs/Shorts Margin Ratio Percentage Rank" by me. I was interested in the ratio of BITFINEX:BTCUSDLONGS to BITFINEX:BTCUSDSHORTS as a measure of market sentiment and how that sentiment would magnify RSI changes. The volatility of the BTCUSDLONGS : BTCUSDSHORTS ratio was too low to get a good read, using a percent rank of the RSI of the ratio made the results more visible. After a discussion with @jason5480 I saw how opening it up to all margined Long / Short pairs was the best way forward. Unfortunately the name no longer matched the script, so I had to publish a new script.

發布通知

1.01
• Added an automatic pair option
By default the indicator now plots the RSI of the current token with a color based on percentage rank the RSI of BITFINEX:'token'LONGS divided by BITFINEX:'token'USDSHORTS. If you are using a chart that does not have BITFINEX LONGS and SHORTS tokens it will error and display nothing.

• Got rid of the average, not needed

• Added alerts
Alerts can be triggered and or shown on the chart when the Ratio is Above / Below specified values, with the option to filter by the RSI being beyond the displayed upper and lower limits and or the RSI above / below its moving average.
The three indicators displayed in this update show the 1hr ETHUSD with alerts based on:
Indicator 1: RSI Beyond Bands, RSI MA Filter, Ratio Below 5 and Ratio Above 95
Indicator 2: RSI Beyond Bands, Ratio Below 2 and Ratio Above 98
Indicator 3: RSI MA Filter, Ratio Below 2 and Ratio Above 98

發布通知

1.02
• Automatic matching is now far more likely to show a result, it will show the USD pair most of the time unless a closer match exists or manually set.
• Celebrating the easier matching with an ADAAUD chart that is automatically showing AUAUSD Longs and Shorts.
• Set long and short symbol defval to '' so BINANCE:BTCUSDLONGS doen't show up in the chart unless it is set.
• Since the manual settings now default to '' it will be automatic unless a manual setting is entered. If it has been entered it is not automatic, so Auto setting is no longer required,
• If the currency is USD, UST or BTC it will automatically use the chart pair for longs and shorts.
• If the currency is EUR, GBP or JPY and the base is ETH or BTC it will automatically use the chart pair for longs and shorts.
• Otherwise it will use the USD pair for longs and shorts.

發布通知

1.03
• Added histogram style.
My new favourite and the bottom in the examples on the chart. Displays the ratio as an area histogram with a base of 50, when used with the RBlG spectrum as in the example the unimportant area in the middle doesn't show anything.
• Modified to just display the normal RSI where no BITFINEX LONGS exist.
I use this indicator on my standard daily chart and when I was looking at non-crypto or crypto without BITFINEX LONGS and SHORTS it was just showing an error. Modified to just show the normal RSI in those situations.
• Added @DevLucem Divergence library to alert on RSI divergences.
Alerts can now be triggered on RSI divergences, thanks DevLucem for the library!

發布通知

Updated Description to match current functionallity.
評論
truthfulPie1984
this might sound like a stupid question but does the red represent a higher ratio of SHORTS or does it indicate a high level of LONGS (and so there for the red is a warning of that?) ??
thanks so much :)
EltAlt
@truthfulPie1984, red means more longs are have been opened, so if they're right it's going up, but if they're wrong the squeeze from those longs closing will accelerate the move down. There are a few different colour options but longs are red in them all, but you've got the source if you want to change that ;)
truthfulPie1984
@EltAlt, thanks so much for clarifying!
EltAlt
Has anyone got any ideas how to improve the alerts?
Maximalist1997
Thanks for this!! Is it possible to adjust for different coins? I mean, sorry about the dumb question, but when I change to for example ADAUSD, the script adjusts the margin tickers automatically or should I change in the script?
EltAlt
@Maximalist1997, Hi, assuming that you're using the latest version it does automatically adjust to different coins..... but BINANCE:BTCUSDLONGS and BINANCE:BTCUSDSHORTS always shows on the chart, which is bound to cause confusion! OK, updating......
EltAlt
@Maximalist1997, take a look at the new version.
Maximalist1997
@EltAlt, Thanks man!
更多