Risk & Strategy

Critical Risk And Strategy Notes

Core issues, required code-level fixes, and operational stop conditions before any scale-up.

Critical Findings

Position sizing mismatch

If qty mode and exchange contract model are misaligned, orders can be dramatically over- or under-sized.

No enforced downside cap

Without hard stops and daily loss limits, a single adverse regime can cause catastrophic drawdown.

Whipsaw-sensitive reversal logic

Always-in-market reversal behavior can churn fees heavily during range-bound conditions around the EMA.

Cost drag under market-order flow

Round-trip fees plus slippage can erase expected edge if trade frequency remains high.

Required Fixes (Implementation)

Fix position sizing to quantity model

// Risk percentage model
risk_percent = input(1.0, title="Risk % Per Trade") / 100
risk_amount = strategy.equity * risk_percent
position_size_usd = risk_amount / risk_per_unit_long
btc_qty = position_size_usd / close
strategy.entry("Long", strategy.long, qty=btc_qty)

Attach stop loss and take profit

stop_loss_long = up
risk_long = close - stop_loss_long
take_profit_long = close + (risk_long * 2.0)

strategy.entry("Long", strategy.long, qty=btc_qty)
strategy.exit("Exit Long", "Long", stop=stop_loss_long, limit=take_profit_long)

Enforce daily limits and trade pacing

max_daily_loss = input(500, title="Max Daily Loss USD")
min_bars_between = input(10, title="Min Bars Between Trades")
max_daily_trades = input(5, title="Max Trades Per Day")

allow_trades = daily_pnl > -max_daily_loss and trades_today < max_daily_trades and bar_index - last_trade_bar >= min_bars_between

Reduce EMA-border noise with buffer

ema_buffer_percent = input(0.5, title="EMA Buffer %") / 100
ema_upper = ema200 * (1 + ema_buffer_percent)
ema_lower = ema200 * (1 - ema_buffer_percent)

longCondition = crossover(close, dn) and close > ema_upper
shortCondition = crossunder(close, up) and close < ema_lower

Strategy Behavior Summary

Performs best in

  • Sustained directional trends with clear EMA separation.
  • Higher-volatility regimes with consistent follow-through.
  • Market phases with fewer false breakouts.

Performs worst in

  • Range-bound chop around the 200 EMA.
  • Low-volatility consolidations with false signal clusters.
  • Thin-liquidity windows causing fill slippage.

Stop-Trading Triggers

  • Daily loss cap breached.
  • Account drawdown exceeds 25% of baseline.
  • Five or more consecutive losses under normal conditions.
  • Execution anomalies, duplicated actions, or unexplained position drift.
  • Exchange or infrastructure instability during active exposure.
Never increase risk after short winning streaks. Scale only after measured, multi-session consistency.

Risk Disclaimer

This material is for system design and operational planning only. It is not financial advice. Trading leveraged products can result in full capital loss.