FLATAFTER

Category: ProBacktest

The FLATAFTER instruction in ProBuilder language is designed to manage trading operations by automatically closing all open positions and cancelling any pending orders after a specified time. This function is particularly useful for traders who wish to limit their trading activity to specific times of the day, ensuring that no positions are left open or new orders are made beyond this time.

Syntax:

DefParam FlatAfter = HHMMSS

Example:

To automatically close all positions and cancel pending orders at 3:30 PM, you would use the following line of code:

DefParam FlatAfter = 153000

This setting ensures that after 3:30 PM, no open positions or pending orders remain in the system. It is particularly useful for day traders who operate within specific market hours and wish to ensure all trading activity is concluded by a certain time.

Additional Information:

  • The time specified in the FlatAfter parameter should be in the format of HHMMSS, where HH stands for hours, MM for minutes, and SS for seconds, based on a 24-hour clock.
  • This function is crucial for implementing time-based strategies and can help in risk management by ensuring that no trades are left open overnight or during times of low liquidity.

Understanding and using the FLATAFTER function can significantly aid in automating and managing the operational aspects of trading strategies within the ProBuilder environment.

Related Instructions:

  • FLATBEFORE probacktest
  • Logo Logo
    Loading...