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 GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,279 views
          0 likes
          Last Post Leafcutter  
          Started by WHICKED, Today, 12:45 PM
          2 responses
          19 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Tim-c, Today, 02:10 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Taddypole, Today, 02:47 PM
          0 responses
          5 views
          0 likes
          Last Post Taddypole  
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          51 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Working...
          X