• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 Managed Orders: How to get list of current orders

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

    NT8 Managed Orders: How to get list of current orders

    I'm using a managed order approach & am having trouble with almost hourly crashouts because of Order rejected due to “OCO ID cannot be reused”
    Then the strategy stops due to RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; And sometimes leaves an unprotected position.
    I’m moving the stops to follow up price action so probably at some points the target is filled & strat is still trying to move the stop up.

    #1 Is there a way to improve this issue & not have it crash all the time?
    #2 Failing any solution is there a way to check if any outstanding orders exist? What I would like to do is set RealtimeErrorHandling.IgnoreAllErrors
    and every bar if there is a current position I would check if there is a stop & target order. If there’s not orders & an open position I will flatten position.
    My goal is to keep the strategy running without having to stop & restart it every time there’s an error.

    Any help appreciated.

    #2
    Hello saturntd,

    Are you using unique OCO orders or are you attempting to pair these with orders that are filled or cancelled?

    How are you making OCO Ids? Are these using a unique string generator like GetAtmStrategyUniqueId()?
    Are you adding the CurrentBar number to the OCO string?
    Are you adding a datetime to the string to ensure these are unique?
    Are you using a counter to increment each new order pair to ensure they are unique (is the strategy being enabled and re-enabled or are there multiple instances being enabled?)

    You would need to add orders to some array or collection to track them if you want to track working orders. It is possible to do but requires custom code.
    An example that may help is linked below.
    http://ninjatrader.com/support/forum...325#post490325
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,
      I'm using the Ninja Managed Approach to orders & the orders are part of a named group.
      Ninja is the one creating OCO Ids.
      SetProfitTarget, SetStopLoss, EnterShortLimit all have the same name.

      Comment


        #4
        Hello saturntd,

        I would not expect SetStopLoss() or SetProfitTarget() to re-use OCO ids. EnterShortLimit() cannot use an OCO ID.

        Please send an email to platformsupport [at] ninjatrader [dot] com so that we may request your log and trace files. In the email please include a link to this forum thread.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by psquare, Today, 03:11 PM
        4 responses
        18 views
        0 likes
        Last Post psquare
        by psquare
         
        Started by ballboy11, Today, 03:20 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by tonynt, Today, 02:18 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_JoshG  
        Started by denalek2419, Today, 01:46 PM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by REI140205, Today, 12:58 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Jim  
        Working...
        X