DEFPARAM is a directive in the ProBuilder language used to define various execution and environment parameters for a trading strategy. This directive is crucial for setting up how orders are managed and when the strategy should be active during the trading session.
DEFPARAM ParameterName = Value
Common parameters include:
DEFPARAM CumulateOrders = false // No accumulation of orders
DEFPARAM FlatBefore = 090000 // Close all positions before 9:00 AM
DEFPARAM FlatAfter = 173000 // Do not open new positions after 5:30 PM
This example sets up a trading strategy where no orders are accumulated (each new signal leads to the closure of an existing position before opening a new one), all positions are closed before 9:00 AM, and no new positions are opened after 5:30 PM.
Understanding and correctly setting DEFPARAM is essential for controlling the operational conditions of your trading strategy, ensuring it operates only under desired circumstances.