strategy.risk.max_intraday_filled_orders() - Pine Script Function
strategy.risk.max_intraday_filled_orders()
Section titled “strategy.risk.max_intraday_filled_orders()”Overview
Section titled “Overview”The purpose of this rule is to determine maximum number of filled orders per 1 day (per 1 bar, if chart resolution is higher than 1 day). The rule affects the whole strategy. Once the maximum number of filled orders is reached, all pending orders are cancelled, all open positions are closed and no new orders can be placed till the end of the current trading session.
Syntax
Section titled “Syntax”strategy.risk.max_intraday_filled_orders(count, alert_message) → voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| count | simple int | A required parameter. The maximum number of filled orders per 1 day. |
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6strategy("risk.max_intraday_filled_orders Demo")strategy.risk.max_intraday_filled_orders(10) // After 10 orders are filled, no more strategy orders will be placed (exceptfor a market order to exit current open market position,if there is any).if open > closestrategy.entry("buy", strategy.long)if open < closestrategy.entry("sell", strategy.short)