OPEN-SOURCE SCRIPT
업데이트됨 Position Size CalC

Auto calculates position size based on preset risk and max allocation
릴리즈 노트
Enhanced Position Size CalC (TradeCalc)Enhanced Position Size CalC is a decision-support indicator designed to turn a chart into a complete trade planning and risk management workspace. It calculates position size, stop loss, and profit targets automatically based on your account parameters, while still allowing full manual control when you need it.
This is not a signal generator. It assumes you choose the trade. The indicator’s job is to answer the harder questions:
Where is my risk? How big should the position be? What does 2R actually mean in dollars and shares?
---
What the Indicator Does
Once applied to a chart, the indicator:
• Determines a logical stop-loss using price structure (support)
• Calculates risk per share and a fixed 2R profit target
• Sizes the position based on account risk % and max allocation rules
• Visually plots Entry, Stop, and 2R Target directly on the chart
• Displays a live position sizing table with shares, tranches, risk, and profit
• Triggers alerts when Stop Loss or 2R Target is hit
Everything updates dynamically with price.
---
Stop-Loss Logic (Auto Modes)
You can choose how the stop loss is calculated:
Smart Support (default)
Scans recent price action to find meaningful support levels based on repeated touches within a lookback window. A buffer (%) is applied below support to reduce stop hunts.
Pivot Low
Uses recent pivot lows for a cleaner, swing-based stop.
Simple Low
Uses the lowest low over a defined lookback. Simple, mechanical, and conservative.
A percentage buffer can be added below any support level.
---
Risk & Position Sizing
Position size is calculated using two independent constraints:
Risk-based sizing
Limits total dollar loss to your defined Risk per Trade (%).
Allocation-based sizing
Caps the position so it never exceeds Max Allocation (%) of your account.
The indicator automatically chooses the smaller of the two and clearly labels when allocation is the limiting factor.
---
Overrides (Full Manual Control)
You can override any part of the automation:
• Entry Price Override – Use a planned entry instead of current price
• Stop Loss Override – Force a custom stop level
• Position Override (Shares) – Fix position size manually
When overrides are active, the table clearly shows MANUAL OVERRIDE mode so nothing is hidden or ambiguous.
---
2R Framework (Risk-Multiple Based)
The indicator is built around a 2R risk model:
• R = Entry − Stop
• 2R Target = Entry + (2 × Risk per Share)
It calculates and displays:
• Exact 2R price level
• Dollar profit at 2R
• Percentage return at 2R
This keeps the focus on expectancy and consistency, not arbitrary price targets.
---
Alerts
Two alerts are available:
Stop Loss Execute
Triggers when price crosses below the active stop level.
2R Target Execute
Triggers when price crosses above the 2R target.
Designed for partial profit taking (e.g., sell 50%).
Alerts use invisible plotted levels, so they remain accurate even if visuals are turned off.
---
Visual Output
On the chart: • Entry line (blue)
• Stop-loss line (red, dashed)
• 2R target line (green)
On the table: • Total position size
• Two 50% tranches
• Dollar risk and real risk %
• 2R profit in dollars and %
• Status flags (Risk Optimized / Allocation Limited / Manual Override)
---
Who This Indicator Is For
• Swing traders and position traders
• Traders who think in R-multiples, not predictions
• Anyone who wants risk defined before clicking buy
• Traders who want discipline without rigidity
---
Important Note
This indicator does not tell you when to trade.
It tells you how much, where you’re wrong, and what success actually pays.
Used correctly, it turns impulsive trades into structured bets—and makes risk visible before it becomes real.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.