Appearance
Personalize your experience
Mode
Accent Color
Layout
Direction
Order Flow Imbalance
Featured₹999Approximates buy/sell pressure from OHLCV bar structure
4.5(143)
1.8k installs 620 2 commentsP
order-flowdeltavolumesmart-moneyinstitutional
Live Preview — BTC/USDT
About
Detects order-flow imbalance by analyzing wick ratios and volume delta. Generates buy/sell zone signals when cumulative delta exceeds threshold.
Method
• Wick-ratio based buy/sell pressure approximation
• Cumulative delta over configurable lookback
• Zone signals when threshold exceeded
Outputs & Parameters
Outputs
Imbalance Lineline
Buy/Sell Zonesdots
Parameters
Lookback Bars14
Signal Threshold2
Show Zonestrue
Source Code
Edit in IDEtypescript
| 1 | // Order Flow Imbalance — Quatick IDE |
| 2 | // SDK math globals available: sma, ema, atr, rsi, macd, bollingerBands, vwap, etc. |
| 3 | |
| 4 | const metadata = { id: 'order-flow', name: 'Order Flow Imbalance', version: '1.0.0', category: 'volume' }; |
| 5 | |
| 6 | interface BarData { |
| 7 | time: number; |
| 8 | open: number; |
| 9 | high: number; |
| 10 | low: number; |
| 11 | close: number; |
| 12 | volume?: number; |
| 13 | } |
| 14 | |
| 15 | const defaultParams = { smoothing: 5 }; |
| 16 | |
| 17 | /** |
| 18 | * Approximates order-flow delta from OHLCV bar structure. |
| 19 | * Positive value = buy pressure dominant; Negative = sell pressure dominant. |
| 20 | */ |
| 21 | function calculate(bars: BarData[], params = defaultParams): { time: number; value: number }[] { |
| 22 | const deltas = bars.map(bar => { |
| 23 | const range = bar.high - bar.low; |
| 24 | if (range === 0) return 0; |
| 25 | const buyPressure = (Math.max(bar.open, bar.close) - bar.low) / range; |
| 26 | const sellPressure = (bar.high - Math.min(bar.open, bar.close)) / range; |
| 27 | return (buyPressure - sellPressure) * (bar.volume ?? 1); |
| 28 | }); |
| 29 | |
| 30 | // Smooth the delta using the SDK sma() global |
| 31 | const smoothed = sma(deltas, params.smoothing); |
| 32 | |
| 33 | return bars |
| 34 | .map((bar, i) => ({ time: bar.time, value: smoothed[i] })) |
| 35 | .filter(p => !isNaN(p.value)); |
| 36 | } |
Read-only preview. Open in the QuaTick IDE to edit and deploy.
Reviews
No reviews yet. Be the first to review this listing.
Discussion
Sign in to join the discussion.