OPEN-SOURCE SCRIPT
SmartFlow Position Sizer

SmartFlow Position Sizer automatically calculates your lot size based on account balance, risk percentage, and stop loss distance. Just click twice โ Entry and SL โ and let the math do the work. No spreadsheets. No guessing. Trade with discipline.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WHAT IT DOES
This indicator solves the most common mistake in trading: incorrect position sizing.
You set your account balance and risk %. Then click your Entry and Stop Loss directly on the chart. The indicator instantly calculates:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HOW TO USE
Step 1 โ Add the indicator to your chart
Step 2 โ Click on the chart to set your Entry Price (1st click)
Step 3 โ Click again to set your Stop Loss (2nd click)
That's it. The table and SL/TP zones appear immediately.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TABLE DISPLAY
The on-chart table shows everything at a glance:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VISUAL ZONES
Zones are drawn between your click positions, not fixed to the latest bar. This means you can place Entry and SL anywhere on the chart โ including future empty areas โ to plan trades visually before price arrives.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LOT CALCULATION FORMULA
Lot = (Balance ร Risk%) / (SL Distance ร Contract Size)
Example: $10,000 balance, 2% risk, SL distance = $20, contract size = 100
โ Lot = ($10,000 ร 0.02) / ($20 ร 100) = 0.10 lots
The result is rounded down to the nearest 0.01 to avoid exceeding your risk limit.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SETTINGS
Account Settings
Take Profit
ATR Volatility
Display
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NOTES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WHAT IT DOES
This indicator solves the most common mistake in trading: incorrect position sizing.
You set your account balance and risk %. Then click your Entry and Stop Loss directly on the chart. The indicator instantly calculates:
- Lot size โ based on your risk tolerance and SL distance
- Take Profit โ auto-calculated from your R:R ratio
- P&L in USD โ expected profit and max loss displayed
- ATR volatility โ current vs average ATR to gauge market conditions
- Long/Short auto-detection โ determined by Entry vs SL position
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HOW TO USE
Step 1 โ Add the indicator to your chart
Step 2 โ Click on the chart to set your Entry Price (1st click)
Step 3 โ Click again to set your Stop Loss (2nd click)
That's it. The table and SL/TP zones appear immediately.
- Drag the Entry or SL line to adjust โ all calculations update in real time
- Change R:R ratio in settings to move the TP level
- Long or Short is detected automatically โ no manual selection needed
- Works in future (empty) chart areas โ plan trades before price arrives
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TABLE DISPLAY
The on-chart table shows everything at a glance:
- ATR โ current ATR value with period
- ATR Avg โ average ATR for volatility comparison
- Vol Ratio โ current ATR / average ATR (orange when elevated)
- Balance โ your account balance in USD
- Risk % โ max loss percentage per trade
- Entry โ entry price with LONG/SHORT label
- Lot โ calculated position size
- R:R โ risk-to-reward ratio
- TP โ take profit price and expected profit in USD
- SL โ stop loss price and max loss in USD
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VISUAL ZONES
- White line โ Entry price
- Red zone โ SL area (loss zone) with dollar amount on label
- Green zone โ TP area (profit zone) with dollar amount on label
Zones are drawn between your click positions, not fixed to the latest bar. This means you can place Entry and SL anywhere on the chart โ including future empty areas โ to plan trades visually before price arrives.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LOT CALCULATION FORMULA
Lot = (Balance ร Risk%) / (SL Distance ร Contract Size)
Example: $10,000 balance, 2% risk, SL distance = $20, contract size = 100
โ Lot = ($10,000 ร 0.02) / ($20 ร 100) = 0.10 lots
The result is rounded down to the nearest 0.01 to avoid exceeding your risk limit.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SETTINGS
Account Settings
- Balance (USD) โ Your account balance. Default: 10,000
- Risk per Trade (%) โ Max loss per trade. Default: 2%
- Contract Size (per Lot) โ MT5 contract size. XAUUSD = 100. Adjust for your broker
Take Profit
- R:R Ratio โ TP is calculated as SL distance ร this value. Default: 1.5
ATR Volatility
- ATR Period โ Default: 14
- ATR Average Period โ For comparing current volatility vs average. Default: 50
Display
- Table position (4 corners), text size, SL/TP zone toggle
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NOTES
- Works on any instrument โ Gold, Forex, Crypto, Indices
- Designed for MT5/MT4 lot sizing โ adjust Contract Size for your broker
- ATR volatility ratio turns orange when current ATR exceeds 1.5x the average โ a visual warning that volatility is elevated
- All calculations use USD-denominated accounts
- Drawing positions use time-based coordinates, enabling placement in future chart areas
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
SmartFlow Pro โ SMC detection (OB/BOB, FVG/iFVG, OTE, Confluence, Alerts) +
Position Sizer Pro โ (partial TP, trailing SL, risk mgmt).
โ whop.com/smartflow-indicators/smartflow-pro/
Position Sizer Pro โ (partial TP, trailing SL, risk mgmt).
โ whop.com/smartflow-indicators/smartflow-pro/
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
SmartFlow Pro โ SMC detection (OB/BOB, FVG/iFVG, OTE, Confluence, Alerts) +
Position Sizer Pro โ (partial TP, trailing SL, risk mgmt).
โ whop.com/smartflow-indicators/smartflow-pro/
Position Sizer Pro โ (partial TP, trailing SL, risk mgmt).
โ whop.com/smartflow-indicators/smartflow-pro/
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.