Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.strategy.risk.max_position_size
On this pageSignatureParametersReturnsExample

Strategy / Reference

alerta.strategy.risk.max_position_size

TradingView-compatible spelling: strategy.risk.max_position_size, runs without warnings

Caps the quantity of any entry order to the specified size.

alerta.strategy.risk.max_position_size(size) → void

Parameters

NameTypeRequiredDefaultDescription
sizefloatYes—Maximum allowed position size.

Returns

void

Example

alerta.strategy.risk.max_position_size
strategy("Risk: Max Size", overlay=true)strategy.risk.max_position_size(10)strategy.entry("BigOrder", "long", 100) // will be capped to 10

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.