RightEdge - The Ultimate Backtesting and Trading System Development Platform

Setting a Timeout

Timeouts can be set one of two ways in RightEdge.  The first method involves setting the value at the system level within the trading system project settings.  Once a trading system is open, click on the top most tree item in the Trading System pane.  This will display the global properties for this trading system.  If the Properties pane does not appear, force it to the visible state by selecting Properties Window from the View menu.


The Bar Count Exit field is highlighted above.  Note that this is represented as a whole number and not a decimal.  So in the case demonstrated above, a 10 bar timeout has been set.  Set the timeout field to 0 if no timeout order is desired.

Timeout orders can also be set in code where they can be controlled more dynamically.


public class SystemMain : SystemBase


    public override void Startup()


        // Setting a global timeout for 10 bars

        PositionManager.BarCountExit = 10;



Visual Basic

Public Class SystemMain

Inherits SystemBase

    Public Overloads Overrides Sub Startup()

        ' Set a global timeout for 10 bars

        PositionManager.BarCountExit = 10

    End Sub

End Class

The samples above show the timeout being set in the startup function.  This is identical to setting the timeout in the system properties.  However, the BarCountExit variable can be set in any function and it is honored whenever a new position is opened (not necessarily when it is submitted).

See Also


New Trading System

Trading System Pane