INVITE-ONLY SCRIPT

Volume Analysis

93
🙏🏻 (signed) Volume Analysis is 2 of 2 structural layer / ordeflow analysis scripts, while the first one is Liquidity Analysis. Both are independent so can’t be released together as a single script, but should be used together.

The same math used in this script can be applied to other types of aggressive volume data: non-aggregated flow of market orders, volume traded of put vs call options.

There’s no universal agreement about terminology, but this script works with volumes signed by the aggressor who initiated a transaction. Then these volumes get aggregated by time and a cumulative sum is calculated. Mostly this is widely known as Cumulative Volume Delta.

However this script works with 'inferred' volumes vs the provided ones. It’s the better choice for equities, bonds; neutral choice for currencies; and suboptimal choice for natural and artificial commodities.


Contents:
  1. Output description;
  2. How to analyze & use the outputs;
  3. How to use it together with Liquidity Analysis script;
  4. How did I use both scripts to finish The Leap profitably and skipped many losses.



1. Output description
ekran görüntüsü
  • Color of the CVD line reflects (signed) volume imbalance state: red is negative, purple is neutral, blue is positive.
  • 3 purple lines are lower deviation (lower band), basis (middle band), upper deviation (upper band): used to generate signals by a ruleset that would be explained in a minute
  • Gray number in the script’s status line is the advised input you may put into Inferred volume multiplier in script’s setting, I will explain it
  • Vertical dash line marks the moving window end, this way you can be certain over what exact data you see the profile was built.



2. How to analyze & use the outputs
Setup up the script:
  • Moving window length: set it to ~ ¼ of your data analysis window. E.g if you see on your charts and use ~ 256 bars, set the length to 64.
  • Inferred volume multiplier: you can easily leave it 256, this is not a critical factor for the math, it’s mostly there if you want to ~ equate inferred volumes with real ones in scale. For this, use the gray number in the script status line, it’s calculated as ratio of long term real volumes weighted avg to long term inferred volumes weighted avg.
  • Again, changing the inferred volume multiplier won’t affect the math.
  • Use 2 timeframes: main one and a far lower one 3 steps down, just like on the screenshot.


Find out current volume imbalance state:
As mentioned before, based on CVD line color, it can be negative, neutral or positive. This is the state variable that changes slowly and denies/confirms the signals generated by crossovers of CVD line and 3 purple thresholds.

For this I use my own very fast and lightweight metric that is totally statistically grounded, utilizes temporal information, and calculates volume imbalance without using heavy math like regressions as it’s usually done. It also provides a natural neutral zone, when volume imbalance is not strong enough to be confirmed.

...

CVD-based signals:
First you need to understand what precisely a touch of a threshold is:

Touch: an event when either of these 2 happens:
  • One CVD datapoint is above the threshold, and the next CVD datapoint is below the threshold
  • One CVD datapoint is below the threshold, and the next CVD datapoint is above the threshold

These are usually called crossovers/crossunders.

Now with the 3 purple thresholds we follow this logic:
  • Monitor the last touched threshold;
  • Once another threshold is touched, here we may generate a signal but only once !, after the first generated signal at that threshold we can’t generate more signals on this threshold, we need to wait when CVD comes to another threshold.
  • If CVD touches one threshold, and then goes down and touches another threshold downwards, we wait when CVD makes a datapoint above this threshold. When it happens, we register a long signal
  • If CVD touches one threshold, and then goes up and touches another threshold upwards, we wait when CVD makes a datapoint below this threshold. When it happens, we register a short signal


However, don’t open new trades against the current volume imbalance state. So don’t open shorts when the CDV line is blue, and don’t open longs when CVD line is red.

Btw, this technique I call it “reclaim” of a level/threshold. It can be applied to horizontal levels, and it’s very powerful especially when you fade levels on very volatility assets like BTC. This technique allows you to Not fade a level straight away, but wait when price goes past the level a bit, and then comes back and reclaims it, only there you enter, and moreover you now have a very well defined risk point.

The last part is multi-timeframe logic. Prefer to act when a lower timeframe is Not against the main timeframe. That’s all, no multiple higher timeframes are needed.


3. How to use it together with Liquidity Analysis script.
That script also has a mean to generate its own signals, and another state variable called Liquidity Imbalance.

So now you’re not only looking at volume imbalance but also at liquidity imbalance that would deny/confirm the CVD based signal. You need at least one of these two to favor your long or short.

This is the same logic widely used in HFT, where MM bots cancel/shift/resize orders when book is too onesided And ordeflow is one sided as well.


4. How did I use both scripts to finish The Leap profitably and skipped many losses.
Even tho you can use structural information as your main strategic layer, as many so-called orderflow traders do, I traded in objective style: my fade signals were volatility based in essence, and I used ordeflow for better entries and stops, but most importantly to skip losses.

When ‘both‘ liquidity imbalance and volume imbalance (in their main timeframes) were against my trades, I skipped them all, saving many ~$500 stop losses (that was my basis risk unit for the Leap). Unless I had a very strong objective signal, i.e. confluence of several signals, or just one higher timeframe signal, I did all these skips.

I traded ~ intraweek timeframe, so I was analyzing either the last 230 30min bars or 1380 5min bars. Both Liquidity Analysis and (signed) Volume Analysis scripts were set to moving window length 46 or 276 for either granularity.

I finished the leap with 9% profit and max DD ~ 5%, a bit short of my goal of 12.5%. If not these 2 scripts I would’ve finished a bit above breakeven I think.

,,,

Another thing, I made these 2 scripts invite-only because they are made particularly for trading, particularly for certain types of market data. These are tools adapted for particular use case, not like my other posts with general math entities like Kernel Density Estimation or Kalman filter, that you can take and apply properly on any data you need yourself.

However these are made from general math entities like everything else. ‘All’ the components are available in my other scripts, ideas, and other sources related to me. If you want to reverse-engineer these, you can find all the components you need in my already posted open source work.


Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.