Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Forex Position Management with Interactive Brokers

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

    #16
    Great, Cal

    This was also some very good information and has restored my faith in the ability to get this thing going.

    Now, I just need one more question answered and I think that I will be ready to move forward with purchasing NinjaTrader

    In my discussions with MultiCharts about the same type of topic, here was their response:

    "MultiCharts cannot simply leave the order at IB, because as soon as your strategy stops resubmitting the order, the order is gone.

    In the same vein, you cannot simply take manual ownership over automatically generated orders."

    From what I understand, Stop & Limit Orders through NinjaTrader are hosted on the IB server. Is that correct? If such is true, then I would assume that it is possible to be able to shut down NinjaTrader and the orders would still be active in IB...right? And, then the next day, when NinjaTrader is restarted, would they still be active at IB? Would a new set of IOrders placed the second day adversely effect the previous days Stop/Limit Orders if they are still pending?

    The answer to this could cause me to finally move past the testing phase and in to finally purchasing a lifetime license of NT.

    Comment


      #17
      jg123,

      Yes, your assumption is correct here.
      IB natively supports OCO orders. If you entered into a position and had protective orders submitted and accepted with the same OCO ID, then when one fills the other cancels. Additionally, if they were still active when you restarted the next morning the Strategy will try to sync the orders to the Strategy ID.

      Let me know if I can be of further assistance.
      Cal H.NinjaTrader Customer Service

      Comment


        #18
        Great thank you very much for the information. I think that we are getting somewhere.

        Sometimes I wonder if I could just talk on the phone with someone then all of the information and all clarification could be dealt with in 5 minutes rather than several forum posts - but not complaining, you guys are all really great.

        That is wonderful news that the orders are held on the IB server!!

        Originally posted by NinjaTrader_Cal View Post
        jg123,
        Additionally, if they were still active when you restarted the next morning the Strategy will try to sync the orders to the Strategy ID.
        Here we may have an issue and what I may need to figure out how to work around - and hopefully without going the Unmanaged approach.

        Let's assume that an IOrder is used to create some orders. The Entry order gets triggered and the Stop Loss & Limit Orders are placed. For now, we will just discuss the Stop Loss order in hopes to make the example more simple.

        The Stop Loss is set on a currency pair at 1.3500 and the strategy gives it a Strategy ID of "LongStopLoss". The computer is shut down and restarted the next day for trading. The Order is still active in the morning.

        At this point NinjaTrader will start working to manage the order again?

        Furthermore, the strategy on this next day then places IOrder Entry, Stop Loss & Limits. (Not as a bracket order).

        The Stop Loss is placed at 1.3525 and naturally, I assume, the strategy is going to assign this Stop Order with "LongStopLoss". So will this cause the original Stop Loss to also move to 1.3525 because it would have the same order name?

        If so, is it possible to tell NinjaTrader to not sync the orders when I restart it the next day? And/or is it possible to somehow tell NinjaTrader to give the new Stop Loss order a unique Strategy ID if there is already a pending Stop Loss order using IOrder?

        Comment


          #19
          Any update on my last post (#18)?

          This is an incredibly important point here for me

          Thanks!

          Comment


            #20
            jg123, thanks for the clarifications. If you disable the script you can leave the orders working (Tools > Options > Strategies > NinjaScript > Order Handling options), however if you restart a new instance then NT would rerun the historical calculations per default and given that your historical strategy position would be still present coming from historical data and the calculated stop loss be the same > it would take over the working order and be able to continue to manage. All important aspects if this startup would be documented here in our helpguide - https://www.ninjatrader.com/support/..._positions.htm

            For the new orders question, correct if you resubmit an order via the Enter methods > it would just update the order in terms of price / qty.

            Comment


              #21
              Thank you very very much for your response. This continues to move things forward.

              With my goal being that I do not want "yesterday's" stop & limit orders to update, is it then possible that I shut down NT and manually change the stop & limit orders by 1/2 pip and then reopen NT the next day and it will leave the orders as they are?

              I am getting this idea because it says, "A previously generated order is considered to match an active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical."
              It seems, then, that I could accomplish my goal with this because the stop price and the limit prices would no longer be identical as what the strategy is calculating. Almost as a way of "tricking" NT into doing what I want it to do.

              Does that make sense and do you expect that it would accomplish my goal?

              Comment


                #22
                jg123, with that approach you basically ask for a cancel of those orders then. Since they would not be a 100% match anymore and the script could not map them to it's own needed orders for the new instance. Thus resulting in a cancellation.

                Comment


                  #23
                  Ah okay. Thanks

                  This leads me to one more idea.

                  Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled.
                  Based on this, that says, "orders generated by the strategy," can I simply cancel the Stop & Limit orders and then resubmit them? This would then be Manually generated orders rather than Strategy generated orders. Would NinjaTrader stop paying attention to them at that point?

                  Comment


                    #24
                    Yes, manual orders would not be in the scope of the strategy - it would only care about it's own orders.

                    Comment


                      #25
                      Bertrand, you may have just become my favorite person for the entire month if June! This is potentially the best answer I could have gotten.

                      One more, just to confirm that I am completely understanding you.

                      Pretend scenario:
                      Monday Morning
                      Entry order triggered and a stop loss for 1.4500 is placed and a limit order for 1.4600 placed

                      Monday Evening
                      I manually cancel these orders in TWS and immediately manually replace these orders

                      Tuesday Morning
                      NinjaTrader leaves my manually entered stop & limit orders alone. Does not change them, does not cancel them. Instead, it continues as coded to place a new set of orders that, in no way, effects the manually placed orders on Monday evening.

                      Is this a correct scenario?

                      Comment


                        #26
                        Thanks for the kind words, I don't foresee an issue with that - the manual orders wouldn't be a consideration unless you for example send a FlattenEverything, that would run across all accounts and symbols. But they would not be a consideration definitely in your strategy startup process.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        649 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        370 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        109 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        574 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        576 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X