akutsusho

Realtime Footprint

The purpose of this script is to gain a better understanding of the order flow by the footprint. To that end, i have added unusual features in addition to the standard features.

I use "Real Time 5D Profile by LucF" main engine to create basic footprint(profile type) and added some popular features and my favorites.

This script can only be used in realtime, because tradingview doesn't provide historical Bid/Ask date.
Bid/Ask date used this script are up/down ticks.
This script can only be used by time based chart (1m, 5m , 60m and daily etc)
This script use many labels and these are limited max 500, so you can't display many bars.
If you want to display foot print bars longer, turn off the unused sub-display function.

Default setting is footprint is 25 labels, IB count is 1, COT high and Ratio high is 1, COT low and Ratio low is 1 and Delta Box Ratio Volume is 1 , total 29.
plus UA , IB stripes , ladder fading mark use several labels.

///////// General Setting ///////////
Resets on Volume / Range bar
: If you want to use simple time based Resets on, please set Total Volume is 0.
Your timeframe is always the first condition. So if you set Total Volume is 1000, both conditions(Volume >= 1000 and your timeframe start next bar) must be met. (that is, new footprint bar doesn't start at when total volume = exactly 1000).

Ticks per row and Maximum row of Bar
: 1 is minimum size(tick). "Maximum row of Bar" decide the number of rows used in one footprint. 1 row is created from 1 label, so you need to reduce this number to display many footprints (Max label is 500).

Volume Filter and For Calculation and Display
: "Volume Filter" decide minimum size of using volume for this script.
"For Calculation and Display" is used to convert volume to an integer.
This script only use integer to make profile look better (I contained Bid number and Ask number in one row( one label) to saving labels. This require to make no difference in width by the number of digits and this script corresponds integers from 0 to 3 digits).
ex) Symbol average volume size is from 0.0001 to 0.001. You decide only use Volume >= 0.0005 by "Volume Filter".
Next, you convert volume to integer, by setting "For Calculation and Display" is 1000 (0.0005 * 1000 = 5).
If 0.00052 → 5.2 → 5, 0.00058 → 5.8 → 6 (Decimal numbers are rounded off)
This integer is used to all calculation in this script.


//////// Main Display ///////
Footprint, Total, Row Delta, Diagonal Delta and Profile
: "Footprint" display Ask and Bid per row. "Total" display Ask + Bid per row.
"Row Delta" display Ask - Bid per row. "Diagonal Delta" display Ask(row N) - Bid(row N -1) per row.
Profile display Total Volume(Ask + Bid) per row by using Block. Profile Block coloring are decided by Row Delta value(default: positive Row Delta (Ask > Bid) is greenish colors and negative Row Delta (Ask < Bid) is reddish colors.)

Volume per Profile Block, Row Imbalance Ratio and Delta Bull/Bear/Neutral Colors
: "Volume per Profile Block" decide one block contain how many total volume.
ex) When you set 20, Total volume 70 display 3 block.
The maximum number of blocks that can be used per low is 20.
So if you set 20, Total volume 400 is 20 blocks. total volume 800 is 20 blocks too.
"Row Imbalance Ratio" decide block coloring. The row imbalance is that the difference between Ask and Bid (row delta) is large.
default is x3, x2 and x1. The larger the difference, the brighter the color.
ex) Ask 30 Bid 10 is light green. Ask 20 Bid 10 is green. Ask 11 Bid 10 is dark green.
Ask 0 Bid 1 is light red. Ask 1 Bid 2 is red. ask 30 Bid 59 is dark green.
Ask 10 Bid 10 is neutral color(gray)
profile coloring is reflected same row's other elements(Ask, Bid, Total and Delta) too.
It's because one label can only use one text color.



/////// Sub Display ///////
Delta, total and Commitment of Traders
: "Delta" is total Ask - total Bid in one footprint bar. Total is total Ask + total Bid in one footprint bar.
"Commitment of traders" is variation of "Delta". COT High is reset to 0 when current highest is touched. COT Low is opposite.
Basic concept of Delta is to compare price with Delta. Ordinary, when price move up, delta is positive. Price move down is negative delta.
This is because market orders move price and market orders are counted by Delta (although this description is not exactly correct).
But, sometimes prices do not move even though many market orders are putting pressure on price , or conversely, price move strongly without many market orders.
This is key point. Big player absorb market orders by iceberg order(Subdivide large orders and pretend to be small limit orders.
Small limit orders look weak in the order book, but they are added each time you fill, so they are more powerful than they look.), so price don't move.
On the other hand, when the price is moving easily, smart players may be aiming to attract and counterattack to a better price for them.
It's more of a sport than science, and there's always no right response. Pay attention to the relationship between price, volume and delta.
ex) If COT Low is large negative value, it means many sell market orders is coming, but iceberg order is absorbing their attack at limit order.
you should not do buy entry, only this clue. but this is one of the hints.
"Delta, Box Ratio and Total texts is contained same label and its color are "Delta" coloring. Positive Delta is Delta Bull color(green),Negative Delta is Delta Bear Color
and Delta = 0 is Neutral Color(gray). When Delta direction and price direction are opposite is Delta Divergence Color(yellow).
I didn't add the cumulative volume delta because I prefer to display the CVD line on the price chart rather than the number.

Box Ratio , Box Ratio Divisor and Heavy Box Ratio Ratio
: This is not ordinary footprint features, but I like this concept so I added.
Box Ratio by Richard W. Arms is simple but useful tool. calculation is "total volume (one bar) divided by Bar range (highest - lowest)."
When Bull and bear are fighting fiercely this number become large, and then important price move happen.
I made average BR from something like 5 SMA and if current BR exceeds average BR x (Heavy Box Ratio Ratio), BR box mark will be filled.
Box Ratio Divisor is used to good looking display(BR multiplied by Box Ratio Divisor is rounded off and displayed as an integer)

Diagonal Imbalance Count , D IB Mark and D IB Stripes
: Diagonal Imbalance is defined by "Diagonal Imbalance Ratio".
ex) You set 2. When Ask(row N) 30 Bid(row N -1)10, it's 30 > 10*2, so positive Diagonal Imbalance.
When Ask(row N) 4 Bid(row N -1)9, it's 4*2 < 9, so negative Diagonal Imbalance.
This calculation does not use equals to avoid Ask(row N) 0 Bid(row N -1)0 became Diagonal Imbalance.
Ask(row N) 0 Bid(row N -1)0, it's 0 = 0*2, not Diagonal Imbalance. Ask(row N) 10 Bid(row N -1)5, it's 10 = 5*2, not Diagonal Imbalance.
"D IB Mark" emphasize Ask or Bid number which is dominant side(Winner of Diagonal Imbalance calculation), by under line.
"Diagonal Imbalance Count" compare Ask side D IB Mark to Bid side D IB Mark in one footprint.
Coloring depend on which is more aggressive side (it has many IB Mark) and When Aggressive direction and price direction are opposite is Delta Divergence Color(yellow).
"D IB Stripes" is a function that further emphasizes with an arrow Mark, when a DIB mark is added on the same side for three consecutive row. Three consecutive arrow is added at third row.

Unfinished Auction, Ratio Bounds and Ladder fading Mark
: "Unfinished Auction" emphasize highest or lowest row which has both Ask and Bid, by Delta Divergence Color(yellow) XXXXXX mark.
Unfinished Auction sometimes has magnet effect, price may touch and breakout at UA side in the future.
This concept is famous as profit taking target than entry decision.
But, I'm interested in the case that Big player make fake breakout at UA side and trapped retail traders, and then do reversal with retail traders stop-loss hunt.
Anyway, it's not stand alone signal.
"Ratio Bounds" gauge decrease of pressure at extreme price. Ratio Bounds High is number which second highest ask is divided by highest ask.
Ratio Bounds Low is number which second lowest bid is divided by lowest bid. The larger the number, the less momentum the price has.
ex)first footprint bar has Ratio Bounds Low 2, second footprint bar has RBL 4, third footprint bar has RBL 20.
This indicates that the bear's power is gradually diminishing.
"Ladder fading mark" emphasizes the decrease of the value in 3 consecutive row at extreme price. I added two type Marks.
Ask/Bid type(triangle Mark) is Ask/Bid values are decreasing of three consecutive row at extreme price.
Row Imbalance type(Diamond Mark) are row Imbalance values are decreasing of three consecutive row at extreme price.
ex)Third lowest Bid 40, second lowest Bid 10 and lowest Bid 5 have triangle up Mark. That is bear's power is gradually diminishing.
(This Mark only check Bid value at lowest price and Ask value at highest price).
Third highest row delta + 60, second highest row delta + 5, highest delta - 20 have diamond Mark. That is Bull's power is gradually diminishing.

Sub display use Delta colors at bottom of Sub display section.

////// Candle & POC /////////
candle and POC
: Ordinary, "POC" Point of Control is row of largest total volume, but this script'POC is volume weighted average.
This is because the regular POC was visually displayed by the profile ,and I was influenced LucF's ideas.
POC coloring is decided in relation to the previous POC. When current POC is higher than previous POC, color is UP Bar Color(green).
In the opposite case, Down Bar color is used.
POC Divergence Color is used when Current POC is up but current bar close is lower than open (Down price Bar),or in the opposite case.
POC coloring has option also highlight background by Delta Divergence Color(yellow). but bg color is displayed at your time frame current price bar not current footprint bar.


The basic explanation is over.
I add some image to promote understanding basic ideas.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?