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 burtoninlondon, Today, 12:38 AM
          0 responses
          5 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          14 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Yesterday, 08:42 PM
          0 responses
          11 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Yesterday, 07:51 PM
          0 responses
          13 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,983 views
          3 likes
          Last Post jhudas88  
          Working...
          X