Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder Handling

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

    IOrder Handling

    Hi,

    when using iOrder handling, this line works perfectly:

    MyOrder = ExitLong();

    but not this one:

    MyLimitOrder = ExitLongLimit(Price);

    Why?

    #2
    Hello,

    Thanks for posting.

    What error are you getting when using this?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      I'm not getting any error.

      I just want the limit order to set once so I use this code

      if (MyLimitOrder == null)
      {
      MyLimitOrder = ExitLongLimit(Price);
      }

      The value for MyLimitOrder is not set and is always equal to null. So, the code is always accomplishing this condition.

      Comment


        #4
        Hello,

        Are we sure that we are calling it every OnBarUpdate. Otherwise it will not run. Your if condition will not allow this order to remain in the market.

        EnterLongLimit() needs to be called on every on bar update for the order to persist. otherwise it is cancelled.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Thanks,

          It was not an EnterLongLimit() order, it was a ExitLongLimit() as I wrote on the first post.

          I generated the limit order just once. I thought it was permanent till cancel. Is Interactive Brokers willing to accept all my strategies sending a ExitLongLimit() order per second?

          Comment


            #6
            I just found the problem. I had a SetStopLoss order and it's not compatible with the limit order. Problem solved

            thanks

            Comment


              #7
              Excellent.
              BrettNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              65 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              41 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              23 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              26 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              52 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X