Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Avoid multiple orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Avoid multiple orders

    Hello,

    I just found the function EnterLongLimit here in the forum and in the helpGuides.

    To better understand the mechanism, how can I avoid that on each bar my Strategy fires a new order to the order execution network and how can I double-check which orders are already in place before I enter a new order or replace the current order that has been already sent to the system by the Strategy one or more bars before?

    Best regards
    Gerik


    #2
    Hello Gerik ,

    Thank you for the post .

    To know which orders are already in place generally requires that you track that yourself. You can observe the current position information or also store order information to track where you script is currently at.

    EnterLongLimit is actually made so that it should be called for each bar where it should stay active. It would not make a new order unless you provided a new unique signal name each time it is called.

    By default with the managed order handling a limit type order will be cancelled after 1 bar if you don't call this method again. Alternatively in manual coding you can use IsLiveUntilCancelled with these methods to keep them active and only call the method once to submit it.

    You can see the different ways this method can be called in the help guide:


    Code:
    EnterLongLimit(double limitPrice)
    EnterLongLimit(double limitPrice, string signalName)
    EnterLongLimit(int quantity, double limitPrice)
    EnterLongLimit(int quantity, double limitPrice, string signalName)
    The following method variation is for experienced programmers who fully understand Advanced Order Handling concepts:
    EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName)
    And you can see all of the order handling methods here:




    You can find a sample of working with order objects in the following link:




    Storing your orders to variables allows you to keep track of what orders your script has open and what states they are in. This sample provides some explanation of how to "catch" orders in the OnOrderUpdate/OnExecutionUpdate overrides and then track or use them later on. The same would happen for entry orders you use, you could "catch" the order after its submitted to further control your logic or know it is active.


    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X