Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Entry Price

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

    Change Entry Price

    Hello.

    I am very new to ninjatrader and ninjascript, I want to automate an strategy, it is a fast scalper, I set EnterShortStop and EnterLongStop few Ticks behind Bid/Ask price, but sometimes if price goes away, I need to change the entry price how can I achive that? I have to cancel the order and open another?


    Ohter question, the SetStopLoss is only for Long and Short orders? Can't be set to LongStop and ShortStop?

    I am trying to achive what I do on mql

    Thanks

    #2
    Hello hawkfx,

    Welcome to NinjaTrader. If you want to change price only, you do not need to cancel and resubmit separately. If everything is the same (direction, quantity, order type, signal name) except for price, then you just resubmit with the new price and the order is modified.

    SetStopLoss can be used to protect long and short positions. It will automatically place the right order depending on the direction of the trade. There are also dedicated methods for ExitLongStop() and ExitShortStop() that provide for more order control.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I have another question, how can I iterate all pending orders I have working?

      I mean I want to send X amount of longstop or shortstop orders (different or same prices, but different signal name).

      So I want to do it something like this:

      for(i = 0; i < totalpending; i++) {
      //get entry price, signal name, etc
      }

      how can I do it?

      Comment


        #4
        How do I start a new thread. Is the only way to raise a question through replying to a new thread?

        Comment


          #5
          hawkfx,

          We do not support accessing an orders collection directly. To access values about pending orders, you have to work with IOrder objects and advanced framework. You can see here for properties you can expose about orders:


          This sample can help get you started working with these advanced strategy items:
          The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


          sandeshrai,
          Welcome to the NinjaTrader forums. To create a new thread, click the forum category you want to post in, and then click the New Thread button.
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          77 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          27 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          62 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X