Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Managed Buy and Sell Lmt - cant place both?

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

    Managed Buy and Sell Lmt - cant place both?

    Hello,

    Am attempthing to write a fairly simple strategy which upon starting and obtaining data for the close ie last current tick... Places a buylmt below and a sell limit above that obtained price offset a few ticks. Pretty much like fading a band system...

    In OnBarUpdate

    if (Variable0 == 1)
    {
    EnterShortLimit(Variable5,
    "S");
    EnterLongLimit(Variable6,
    "B");
    }

    What happens is that only the first order is placed Short in the above example. If the sell is placed first, only it is placed.

    What I wanted, is to B/S at these points indefenitly until another condition is true.

    When the active order is filled, then an oposing exit and entry order are placed.

    OK, But I want to have both the buy and sell limit order live at startup.

    Is this possible using the managed aproch and if so what am I doing wrong?

    TIA
    rr

    #2
    Hello rr,

    Thanks for the post.

    You can see messages related to strategy order submission by adding TraceOrders = true; to your Initialize() method.

    Your results are expected with the managed order system. Please see here for our Internal Order Handling rules. I have excerpted the rule you're running into.
    Methods that generate orders to enter a position will be ignored if:
    • A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
    • A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
    • The entry signal name is not unique
    • The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction


    We introduced an unmanaged order entry system in version 7 that allows you to submit both long and short orders at the same time. Please see here for an introduction to unmanaged strategyes.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok... Time to take off the training wheels :-)

      Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X