Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Changing working orders from indicator

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

    Changing working orders from indicator

    I'm creating an indicator that executes a limit order using the following method:

    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy();

    Since the action of the order if activated by a user I'm creating this as an indicator and not a strategy. Once the working order has been submitted, but not filled, how can I adjust the limit price of that order? Attempting to use ChangeOrder() from the indicator does not appear to work.

    #2
    Hello martyn73,

    Are you referring to the <account>.Change() method?
    https://ninjatrader.com/support/help...-us/change.htm

    If the .Change() method is not changing the order, assign the AtmStrategy object returned from StartAtmStrategy() to a variable and then call <atmStrategyObject>.AtmStrategyCancelEntryOrder( ).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reference, I got it working using <account>.Change(). I was originally looking at ChangeOrder(), https://ninjatrader.com/support/help...us/?change.htm
      How is that method different?

      Comment


        #4
        Hello martyn73,

        Are you referring to the ChangeOrder() method for NinjaScript Strategies only?

        This will only change an order owned by a NinjaScript Strategy.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          You can change an order from a indicator with


          myAccount.Change ( new [] {stopOrder})

          Also, you can send orders from indicator, with the mothod

          CreateOrder(Instrument instrument, OrderAction act ion, OrderType orderType, OrderEntry orderEntry, T imeInForce timeInForce, int quantity, double limit Price, double stopPrice, string oco, string name, DateTime gtd, CustomOrder customOrder)


          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jbays87, Today, 09:46 PM
          0 responses
          4 views
          0 likes
          Last Post jbays87
          by jbays87
           
          Started by popecapllc, 08-09-2023, 07:42 PM
          9 responses
          1,362 views
          0 likes
          Last Post BartMan
          by BartMan
           
          Started by ETFVoyageur, 04-30-2024, 02:04 PM
          11 responses
          101 views
          0 likes
          Last Post ETFVoyageur  
          Started by bubblegum, 03-18-2024, 10:41 AM
          3 responses
          48 views
          0 likes
          Last Post vjsworld  
          Started by JamesK1, Today, 02:48 PM
          1 response
          13 views
          0 likes
          Last Post JamesK1
          by JamesK1
           
          Working...
          X