Account Protection — System Level

8. Account Protection — System Level

Daily Loss Hard Limit

If daily P/L drops below -(Inp_Daily_Loss_HardLimit)% of balance:
  → g_DailyLossReached = true
  → ALL new orders blocked for the rest of the day
  → Existing positions continue to be managed

Default: 4% of balance.

Drawdown Freeze

If current drawdown > Inp_Drawdown_FreezeLimit%:
  → g_DrawdownFreeze = true
  → New orders frozen

Default: 0.5% (very conservative, ideal for prop firm challenges).

Daily Target Profit

If daily P/L > +Inp_Daily_Target_Profit%:
  → g_DailyTargetReached = true
  → Trading stopped — profit is secured

Default: 15% — after reaching the target, the system shuts itself down for the day.

Equity Trailing Lock (Master)

An equity protection mechanism operating at the account level:

If equity rises by >= Inp_Equity_TSL_Trigger%:
  → Sets an "equity high watermark"
  → If equity drops below (high - Inp_Equity_TSL_Buffer%):
     → Closes ALL positions immediately

Default: Trigger 5%, Buffer 0.2%. Protects against losing a large intraday gain.