OPEN-SOURCE SCRIPT

Position Architect [JOAT]

1 861
Position Architect [JOAT]

Position Architect is an auto-triggered trade-plan visualizer. It consumes a signal source (any plot of another indicator, or a fallback SMA-cross), arms a trade with ATR-scaled stop loss and three risk-reward-scaled targets, and tracks the trade live with breakeven slide, R-multiple lines, MFE / MAE tracking, multi-currency PnL, position sizing, required margin, Kelly sizing suggestion, and a trade-history strip.

cuplikan

What makes it different
  • Most trade-planner indicators are manual: the user clicks entry, stop, and target. Position Architect is auto-triggered via input.source, so it plans trades from external signal feeds (other JOAT indicators or any compatible script).
  • Four trigger modes: Manual toggle, Source-above-SMA, Source-cross-above-SMA, Source-cross-below-SMA. These cover bias, breakout, and counter-trend logics.
  • A three-target ladder (not just one or two) with intermediate R-multiple lines (0.5R, 1R, 1.5R, 2R, 2.5R, 3R) drawn between entry and Target 3 so you see partial-take levels at a glance.
  • Live R-multiple, MFE, MAE displayed next to the trade in real time. After the trade closes, those values are baked into a persistent history label.
  • Kelly sizing suggestion based on an assumed win rate and the current risk-reward, capped at 25% to avoid pathological recommendations.


How it works
  1. The signal source is the user-selected input.source. The trigger rule (one of four modes) determines when a long or short is armed.
  2. On arm: entry equals the current close. SL equals low minus ATR(14) times slMult for longs (or symmetric for shorts). Three targets at entry plus or minus risk times tp1Mult / tp2Mult / tp3Mult.
  3. Lifecycle gates on bar_index greater than tradeBar so the arm bar itself cannot also register hits (preventing spurious instant fills).
  4. Each subsequent bar: check for TP1, TP2, TP3 hits in order, plus stop-loss. TP3 takes precedence over SL on same-bar pierces. If TP1 hits and breakeven is enabled, the stop slides to entry.
  5. Position sizing: pos_size equals (capital times riskPct / 100) divided by (sl_pct / 100). Required margin equals pos_size divided by leverage.
  6. Kelly suggestion: f-star equals winRate minus (1 minus winRate) divided by RR, clamped to 25% max.


Reading the chart
  • Five horizontal price lines: entry (blue), SL (red), TP1 / TP2 / TP3 (green shades), each width 3 to 5.
  • Five price-only labels at the right edge with R-multiples and percentages.
  • Two linefills: a translucent red risk zone between entry and SL, a translucent green reward zone between entry and TP3.
  • bgcolor tint while a trade is open.
  • A 1-bar bgcolor pulse on TP / SL / breakeven events.
  • A live R+0.8 MFE+1.5 MAE-0.3 label updating each bar near current price.
  • Bars-in-trade counter near the entry.
  • Trade-history strip above past entries with W/L outcomes and R-multiples.
  • R-multiple intermediate lines with right-edge labels.
  • A daily trade count plus win-rate summary.
  • A comprehensive dashboard with capital, risk, leverage, R:R, Kelly, position size, required margin, direction, entry, current price, live PnL, status (OPEN / WIN / LOSS), bars in trade.


Signals
  • Trade activated long / short
  • Target 1 / 2 / 3 hit
  • Stop loss hit
  • Breakeven slid

All gated on barstate.isconfirmed or barstate.ishistory. No future references.

Inputs
  • Signal: signal source, trigger mode, signal SMA length, manual long / short toggles.
  • Targets: SL ATR multiplier, TP1 / TP2 / TP3 risk multipliers, breakeven toggle, line extension bars.
  • Capital: capital amount, risk percent, leverage, currency code.
  • Kelly: assumed win rate.
  • Visual: bullish / bearish colors, entry line color, SL line color, TP line color, R-multiple lines toggle, history strip toggle.
  • Dashboard: position, size.


How traders use this
  • Discretionary planning: switch to Manual mode and toggle manualLong / manualShort to drop a complete plan at the current price, with ATR-aware stops and risk-aware sizing.
  • Signal integration: connect Position Architect's signal source to another JOAT indicator's plot output (for example the composite of Iridescent Helix or the Stage-3 line of Sentinel Cascade) and let it auto-arm trades.
  • Risk audit: the dashboard's R:R, position size, required margin, and Kelly suggestion are an instant pre-trade audit. You can compare across instruments.
  • Performance review: the trade-history strip lets you scroll back through recent trades on the chart and see R-multiples without needing a separate journal.


Limitations
  • Kelly sizing assumes a stable win-rate-and-R distribution. Real performance varies. The suggestion is a calibration reference, not a recommendation.
  • Position sizing is in price units. For futures or forex contracts the user must convert to contract count manually.
  • The signal source must be a series compatible with input.source. If the connected indicator does not expose a useful plot, the trigger logic falls back to close.
  • Trade lifecycle assumes one open position at a time. No pyramiding inside this script.


Compatibility
Pine Script v6 open-source indicator (overlay). Any symbol, any timeframe. ASCII currency codes (no Unicode glyphs) for cross-platform display. No request.security calls.

Defaults
SL ATR multiplier 1.5, targets at 1R / 2R / 3.5R, breakeven on after TP1, mint / red palette, ten-thousand-dollar capital with one percent risk and one times leverage, top-right medium dashboard.

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.