stratester.com

Feature

Risk guards

Risk guards are limits the engine applies to every buy, whatever your rules ask for. They keep one aggressive rule from putting the whole account at risk.

The three guards

botscript
guard max_per_trade $2000
guard max_invested 80%
guard stacking on
  • Max per trade: a dollar cap on any single buy. Off by default.
  • Max invested: the largest share of equity that may be in BTC. 100% by default.
  • Stacking: whether a bot may buy more while it already holds a position. Off by default, which means one position at a time.

How a buy is sized

The action asks for an amount, such as 50% of cash or $1,000. If stacking is off and the bot holds BTC, the buy is skipped. Otherwise the amount is cut to the per-trade cap, then to the room left under the max invested share (equity × max % minus the current position), and finally to the cash available. Buys worth less than one cent are skipped.

For a limit or stop order this happens when the order fills, not when it is placed. The amount that passes the guards is the cash spent, fee included.

Common setups

  • All in, one position: the defaults.
  • Scale in carefully: stacking on, max invested 60%, buys of 20% with a cooldown.
  • Fixed risk per idea: max per trade $1,000 with buy 100%.

Risk guards: frequently asked questions

Do guards apply to sells?

No. Guards limit buying. Exits use the take-profit, stop-loss, trailing-stop, trade-age and drawdown blocks.

What happens when a guard cuts a buy to zero?

The buy is skipped and no trade is recorded.

Is max invested measured at the entry price?

It uses the current fill price to value the position and equity at that moment.

Why is stacking off by default?

Most strategies are written for one position at a time, and stacking with a condition that stays true can quickly invest everything.

Simulated results are hypothetical. They include only the fee and slippage you set on the bot, not every real-world cost or market condition, and past performance does not guarantee future results. Nothing here is financial advice.