OPEN-SOURCE SCRIPT

Risk Guard - Position Size & Risk Ceiling

54
What it does

Risk Guard sizes your position from the risk you are willing to take, and tells you immediately when that risk goes above the limit you set for yourself.

Most position size calculators stop at the arithmetic. This one adds the part that actually protects an account: a ceiling.

Why a ceiling

Many traders do not use a fixed risk per trade. They size up on strong setups and down on weak ones. That flexibility is fine, until one trade quietly goes far beyond what the account can absorb.

Risk Guard separates the two:
- Risk for THIS trade is what you are taking right now, and it can change every time.
- Your risk ceiling is your rule, and it does not change.

When the first goes above the second, the table switches to the alert colour and says so plainly.

How to use it

1. Add the indicator. It displays straight away, using the current price and one ATR as demonstration values, so you never face an empty table.
2. Open the settings and enter your own Entry and Stop in the Trade group. Add a Target if you want R:R.
3. Set your account size, the risk for this trade, and your ceiling.
4. Pick the sizing mode and the pip size that match your instrument.

Sizing modes

Lots: gold, forex, CFD. Set the contract size (XAUUSD standard is 100 oz per lot, forex standard is 100000).
Units: crypto and spot.

Whichever you pick, the position size is shown with its unit spelled out and the other unit in brackets, so it cannot be misread.

What it shows

Direction, account size, trade risk against your ceiling, amount at risk, stop distance in price and in pips, position size, R:R and gain at target.

Customisation

Every colour is configurable: header within limit, header when the ceiling is passed, table background, text, position size value, and the entry, stop and target lines. Text size, border width and table position can also be changed.

Notes

Pip size is a setting, not a guess: gold 0.1, forex majors 0.0001, JPY pairs 0.01, and 0 to hide pips on crypto.
The calculation is exact when the quote currency matches your account currency. On crosses where it does not, treat the result as an approximation.
This is a planning tool. It does not place orders and does not read your broker account.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。