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
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by AlgoDreamer, Today, 12:39 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by ninza33, Today, 12:31 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by nleitman, Yesterday, 11:46 AM
        17 responses
        45 views
        0 likes
        Last Post nleitman  
        Started by tradingnasdaqprueba, Today, 03:42 AM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by kaywai, Today, 11:59 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X