Pine Script Daily Profit Cap for Apex's Consistency Rule
Stops new entries once session profit hits a configurable cap — the guardrail an Apex funded account needs so one outsized day can't derail a payout request.
//@version=5
strategy("Target Filled - Daily Profit Cap Example", overlay=true)
// --- Inputs ---------------------------------------------------
profitCap = input.float(750.0, "Daily Profit Cap ($)", step=50,
tooltip="New entries stop once session profit hits this level. For an Apex PA: roughly 25% of the profit target.")
// --- State ------------------------------------------------------
var float pnlToday = 0.0
var bool capped = false
if session.isfirstbar_regular
pnlToday := 0.0
capped := false
if strategy.closedtrades > strategy.closedtrades[1]
pnlToday += strategy.closedtrades.profit(strategy.closedtrades - 1)
if pnlToday >= profitCap
capped := true
// --- Sample signal — replace with your own entry logic ---------
fastMA = ta.ema(close, 9)
slowMA = ta.ema(close, 21)
canLong = ta.crossover(fastMA, slowMA) and not capped
if canLong
strategy.entry("Long", strategy.long)
strategy.exit("Exit", "Long", profit=20, loss=10)
// Visual: green background confirms the cap has been reached
bgcolor(capped ? color.new(color.green, 90) : na, title="Daily Cap Reached") When you need this
Apex's consistency rule checks, at the point of a payout request, whether any single trading day made up too large a share of a funded account's total profit. On the legacy Performance Account that ceiling is 30%; on the newer EOD and Intraday Trailing Drawdown lines it's a more relaxed 50%, measured at payout time instead.
An automated strategy is exactly the kind of thing that can trip this without meaning to. One unusually strong session — a gap, a trend day, a scheduled news reaction — can produce far more than a typical day's result, and without a cap that single session can end up dominating the profit distribution Apex sees at payout.
This snippet is the mirror image of the daily kill switch: instead of watching for losses, it watches for profit and stops opening new trades once the day's gain reaches the configured cap.
How to set the cap
Setting profitCap to roughly 25% of the account's total profit target keeps any single day comfortably under both the legacy 30% figure and the newer 50% one, with room to spare for any small differences between what your script tracks and what Apex calculates internally.
| Apex Account | Profit Target | Suggested Daily Cap (~25%) |
|---|---|---|
| 25k PA | $1,500 | $375 |
| 50k PA | $3,000 | $750 |
| 100k PA | $6,000 | $1,500 |
| 150k PA | $9,000 | $2,250 |
| 300k PA | $20,000 | $5,000 |