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.
DefParam FlatAfter = HHMMSS
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.
Understanding and using the FLATAFTER function can significantly aid in automating and managing the operational aspects of trading strategies within the ProBuilder environment.