DEFPARAM

Category: Instructions

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.

Syntax:

DEFPARAM ParameterName = Value

Common parameters include:

  • CumulateOrders – Determines whether multiple orders can accumulate or if only one order should be open at a time.
  • FlatBefore – Defines a time before which all positions should be closed.
  • FlatAfter – Defines a time after which no new positions should be opened.

Example:

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.

Additional Information:

  • Setting CumulateOrders to true allows multiple simultaneous positions in the same direction (buy or sell).
  • The time format for FlatBefore and FlatAfter is HHMMSS (HourMinuteSecond), which should be adjusted according to the trading exchange’s local time zone.

Understanding and correctly setting DEFPARAM is essential for controlling the operational conditions of your trading strategy, ensuring it operates only under desired circumstances.

Related Instructions:

  • CumulateOrders probacktest
  • FLATAFTER probacktest
  • FLATBEFORE probacktest
  • NOCASHUPDATE probacktest
  • PRELOADBARS probacktest
  • Logo Logo
    Loading...