Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pending Order

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

    Pending Order

    Hi, I want to send a pending order when the market reaches a certain price.

    Is this possible ?

    Regards.

    #2
    Order Pending

    Hi.

    Code:

    if ( Price = touch_price )

    { EnterLong (0,true,contrats,Close[0]+DistanceMarket*TickSize,"Open Long 1");}

    Regards.

    Comment


      #3
      Hello,

      Thanks for the forum post.

      What exactly do you mean by Pending Order? Do you mean sending an order to the exchange to be filled?

      Are you asking about sending a stop order?

      I look forward to assisting you further.
      BrettNinjaTrader Product Management

      Comment


        #4
        Hi, when the price arrive to 1,2300, send a order pending long in 1,2305

        When the price arrive to 1,2305, enterlongstop.

        Can you help me to write the code ?

        Regards.

        Comment


          #5
          You could approach it like this -

          if (Close[0] == xxx)
          EnterLongLimit / StopLimit / Stop

          if (Close[0] == xxx and Position.MarketPosition = MarketPosition.Flat)
          EnterLongLimit / StopLimit / Stop

          Basically if you just resend the order at a new price, but keep the name intact, NinjaTrader would just update it and there would be no need for your to CancelOrder() it specifically.

          If the MarketPosition check on each OnBarUpdate() is not granular enough for your task, you can always work with the IOrder objects to check the fillstates directly in OnOrderUpdate() / OnExecution() -

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmoran13, Yesterday, 01:02 PM
          0 responses
          27 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          18 views
          0 likes
          Last Post PaulMohn  
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          160 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          95 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          148 views
          2 likes
          Last Post CaptainJack  
          Working...
          X