Position Size + Liquidity Check =============================================================================
Position Size Calculator + Liquidity Check
=============================================================================
Position sizing math derived from:
"Position Size Calculator" by Kousik_View (MPL 2.0)
mozilla.org
WHAT IT DOES
Combines two essential pre-trade checks into one indicator:
1. Position sizing - computes quantity, stop loss price, and risk
amount from your account capital, risk-per-trade %, and
stop-loss %.
2. Liquidity verdict - checks whether the stock can actually
absorb that computed position size, by sampling 1m/3m/5m
turnover across the chart bar.
You enter your risk parameters ONCE. The indicator tells you
exactly how many shares to buy AND whether the stock is liquid
enough for that size. No need to type position size manually.
POSITION SIZING FORMULA (Kousik_View)
Risk Amount = Account Capital * RPT% / 100
SL per share = current close * StopLoss% / 100
Stop Loss price = current close - SL per share
Quantity = Risk Amount / SL per share
Position Size = Quantity * current close
Equivalent simplification:
Position Size = Account Capital * (RPT% / StopLoss%)
For Acct=5L, RPT=0.5, SL=2.5 -> Position = Rs.1L regardless of price.
LIQUIDITY CHECK
For each lower-TF bar (1, 3, or 5 min):
turnover = close * volume
Count how many inner bars have turnover < computed position size.
If the count exceeds your threshold, the stock can't absorb your
order without market impact - flagged red.
INPUTS
Risk:
- Account Capital (Rs.)
- Risk per trade %
- Stop Loss %
Liquidity:
- Inner timeframe (1, 3, 5 min)
- Bars below position size to flag illiquid
Display:
- Show table / status line toggles
- Table position (9-way) and text size
DISPLAY
Two-column table with rows:
Qty
SL price Rs.
Risk Rs.
Pos size Rs.
Liquidity % bars below <- red row when illiquid
Avg turn Rs.
Status line shows: Qty, SL price, Risk, % illiquid, Avg turnover.
=============================================================================
Indicador Pine Script®






















