Net Buying/Selling Flows Toolkit [AlgoAlpha]🌟📊 Introducing the Net Buying/Selling Flows Toolkit by AlgoAlpha 📈🚀
🔍 Explore the intricate dynamics of market movements with the Net Buying/Selling Flows Toolkit designed for precision and effectiveness in visualizing money inflows and outflows and their impact on asset prices.
🔀 Multiple Display Modes : Choose from "Flow Comparison", "Net Flow", or "Sum of Flows" to view the data in the most relevant way for your analysis.
📏 Adjustable Unit Display : Easily manage the magnitude of the values displayed with options like "1 Billion", "1 Million", "1 Thousand", or "None".
🔧 Lookback Period Customization : Tailor the sum calculation window with a configurable lookback period, applicable in "Sum of Flows" mode.
📊 Deviation Thresholds : Set up lower and upper deviation thresholds to identify significant changes in flow data.
🔄 Reversal Signals and Deviation Bands : Enable signals for potential reversals and visualize deviation bands for comparative analysis.
🎨 Color-coded Visualization : Distinct colors for upward and downward movements make it easy to distinguish between buying and selling pressures.
🚀 Quick Guide to Using the Net Buying/Selling Flows Toolkit :
🔍 Add the Indicator : Add the indicator to you favorites. Customize the settings to fit your trading requirements.
👁️🗨️ Data Analysis : Compare the trend of Buying and Selling to help indicate whether bulls or bears are in control of the market. Utilize the different display modes to present the data in different form to suite your analysis style.
🔔 Set Alerts : Activate alerts for reversal conditions to keep abreast of significant market movements without having to monitor the charts constantly.
🌐 How It Works :
The toolkit processes volume data on a lower timeframe to distinguish between buying and selling pressures based on intra-bar price closing higher or lower than it opened. It aggregates these transactions and finds the net selling and buying that took place during that bar, offering a clearer view of market fundamentals. The indicator then plots this data visually with multiple modes including comparisons between buying/selling and the net flow of the asset. Deviation thresholds help in identifying significant changes, allowing traders to spot potential buying or selling opportunities based on the money flow dynamics. The "Sum of Flows" mode is unique from other trend following indicators as it does not determine trend based on price action, but rather based on the net buying/selling. Therefore in some cases the "Sum of Flows" mode can be a leading indicator showing bullish/bearish net flows even before the prices move significantly.
Embark on a more informed trading journey with this dynamic and insightful tool, tailor-made for those who demand precision and clarity in their trading strategies. 🌟📉📈
Netpositions
Net Positions (Net Longs & Net Shorts) - By LeviathanThis script is an experimental indicator that visualizes the entering and exiting of long and short positions in the market. It also includes other useful tools, such as NL/NS Profile, NL/NS Delta, NL/NS Ratio, Volume Heatmap, Divergence finder, Relative Strength Index of Net Longs and Net Shorts, EMAs and VWMAs and more.
To avoid misinterpretation, it's important to understand some basics. The “real” ratio between net long and net short positions in a given market is always 1:1. A futures contract is an agreement between two parties to buy or sell an underlying asset at an agreed-upon price. Each contract has a long side and a short side, with one party agreeing to buy (long) and the other party agreeing to sell (short) the asset at the agreed-upon price. The long position holder anticipates that the asset's price will rise, while the short position holder expects it to fall. Because every futures contract involves both a buyer and a seller, it is impossible to have more net longs than net shorts or vice versa (in terms of the net value). For every long position opened, there must be a corresponding short position taken by another market participant (and vice versa), thus maintaining the 1:1 ratio between longs and shorts. While there can be an imbalance in the number of traders/accounts holding long and short contracts, the net value of positions held on each side remains 1 to 1.
Open Interest (OI) is a metric that tracks the number of open (unsettled) contracts in a given market. For example, Open Interest of 100 BTC means that there are currently 100 BTC worth of longs and 100 BTC worth of shorts open in the market. There may be more traders on one side holding smaller positions, and fewer traders on the other side holding larger positions, but the net value of positions on one side is equal to the net value of positions on the other side → 100 BTC in longs and 100 BTC in shorts (1:1). Consider a scenario in which a trader decides to open a long position for 1 BTC at a price of HKEX:30 ,000. For this long order to be executed, a counterparty must take the opposite side of the contract by placing an order to short 1 BTC at the same price of HKEX:30 ,000. When both the long and short orders are matched and executed, the open interest increases by 1 BTC, reflecting the addition of this new contract to the market.
Changes in Open Interest essentially tell us 3 things:
- OI Increase - new positions entered the market (both longs and shorts!)
- OI Decrease - positions exited the market (both longs and shorts!)
- OI Flat - no change in open positions due to low activity or simply lots of transfers of contracts
However, different concepts can be used to analyze sentiment, aggressiveness, and activity in the market by analyzing data such as Open Interest, price, volume, etc. This indicator combines Open Interest data and price action to simplify the visualization of positions entering and exiting the market. It is based on the following concept:
Increase in Open Interest + Increase in price = Longs Opening
Decrease in Open Interest + Decrease in price = Longs Closing
Increase in Open Interest + Decrease in price = Shorts Opening
Decrease in Open Interest + Increase in price = Shorts Closing
When "Longs Opening" occurs, the OI Delta value is added to the running total of Net Longs, and when "Longs Closing" occurs, the OI Delta value is subtracted from the running total of Net Longs.
When "Shorts Opening" occurs, the OI Delta value is added to the running total of Net Shorts, and when "Shorts Closing" occurs, the OI Delta value is subtracted from the running total of Net Shorts.
To summarize:
Net Longs: Cumulative value of Longs Opening and Longs Closing (LO - LC)
Net Shorts: Cumulative value of Shorts Opening and Shorts Closing (SO - SC)
Net Delta: Net Longs - Net Shorts
Net Ratio: Net Longs / Net Shorts
This is the fundamental logic of how this script functions, but it also includes several other tools and options. Here is an overview of the settings:
Type:
- Net Positions (display values of Net Longs, Net Shorts, Net Delta, Net Ratio as described above)
- Relative Strength (display Net Longs, Net Shorts, Net Delta, Net Ratio in the form of a momentum oscillator that measures the speed and change of movements. Same logic as RSI for price)
Display as:
- Candles (display the data in the form of candlesticks)
- Lines (display the data in the form of candlesticks)
- Columns (display the data in the form of columns)
Cumulation:
- Visible Range (data is cumulated from the first visible bar on your chart)
- Full Data (data is cumulated from the beginning)
Quoted in:
- Base Currency (all data is presented in the pair’s base currency eg. BTC)
- Quote Currency (all data is presented in the pair’s quote currency eg USDT)
OI Sources
- Pick the sources from where the data is collected (if available).
Net Positions:
- NET LONGS (show/hide Net Longs plot, choose candle colors, choose line color)
- NET SHORTS (show/hide Net Shorts plot, choose candle colors, choose line color)
- NET DELTA (show/hide Net Delta plot, choose candle colors, choose line color)
- NET RATIO (show/hide Net Ratio plot, choose candle colors, choose line color)
Moving Averages:
- Type (choose between EMA and Volume Weighted Moving Average)
- NET LONGS (show/hide NL moving average plot, choose length, choose color)
- NET SHORTS (show/hide NS moving average plot, choose length, choose color)
- NET DELTA (show/hide ND moving average plot, choose length, choose color)
- NET RATIO (show/hide NR moving average plot, choose length, choose color)
Profile:
- Profile Data (choose the source data of the profile)
- Value Area % (set the percentage width of profile’s value area)
- Positions (set the position of the profile to left or right of the visible range)
- Node Size (set the relative size of nodes to make them appear smaller or larger)
- Rows (select the amount of rows displayed by the profile to control granularity)
- POC (show/hide POC- Point Of Control and select its color)
- VA (show/hide VA- Value Area and select its color)
Divergence finder
- Source (choose the source data used by the script to compare it with price pivot points)
- Maximum distance (the maximum distance between two divergent pivot points)
- Lookback Bars Left (the number of bars to the left of the current bar that the function will consider when looking for a pivot point)
- Lookback Bars Right (the number of bars to the right of the current bar that the function will consider when looking for a pivot point)
Stats:
- Show/Hide the Stats table
- Bars Back (choose the length of data analyzed for stats in number of bars)
- Position (choose the position of the Stats table)
- Select Data you want to display in the Stats table
Additional Settings:
- Volume Heatmap (show/hide volume heatmap and select its color)
- Label Offset (select how much the plot label is shifted to the right
- Position Relative Strength Length (select the length used in the calculation)
- Value Label (show/hide OI Delta values when candles are displayed)
- Plot Labels (show/hide the labels next to the plot)
- Wicks (show/hide wick when candles are displayed)
Code used for generating profiles is taken from @KioseffTrading's "Profile Any Indicator" script (used with author's permission)
COT 3y Rolling IndicatorsThis is an indicator I use in my trading to easily identify the commercial sentiment on Fx-pairs. The indicator show commercials net positions from the CFTC COT reports and also the rolling 3 year max and min