Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Collecting the lists of pending order

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

    Collecting the lists of pending order

    Hello

    i am trying to make my automated strategy script a little bit more robust.
    I am sure that the topic has already been addressed in the forum but couldn't find it.

    if the connection went down how can i update the strategy so that it knows what is the value of stop and take profit orders still waiting for execution (attaching code to onConnectionStatus() ).

    I am only using managed orders instructions.

    Same issue if my computer is resuming after a blue screen with pending stop loss and take profit orders and i restart the strategy.


    Lionel

    #2
    Lionel, thanks for the post and sorry for our late follow up - the sync would be nothing you have to supply in your code, restarting the script in those situations you would hit one of those scenarios shown here - http://www.ninjatrader.com/support/h..._positions.htm

    Comment


      #3
      Bonjour
      Thank you, Bertrand, for this reply. But in fact the question is a little bit different.
      The strategy I am building is managing dynamicaly stop loss and target profit orders.

      It could wait for a flat position before resuming which is feasible but not fully satisfing because the last position will not be managed.
      If the strategy resume immediatly there is a risk of issue as the system will not have info about pending orders.

      I am in fact searching for an instruction which enable to read :
      • the position of the strategy (I have found it)
      • the list of pending stop orders
      • the list of pending take profit orders

      Lionel

      Comment


        #4
        Hi Lionel, there's unfortunately no such collection exposed in supported NinjaScript for access - if the script is restarted NT will recalculate your strategy position and if the running orders are a 100% match it will resuse them, otherwise cancel and reissue as needed.

        If you would like to look deeper 'under the hood' you can check into Account.Orders and Account.Position for example but we would not have any docs on those aspects.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X