Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecutio() and OnOrderUpdate() w/ ATMStrategyCreate()

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

    OnExecutio() and OnOrderUpdate() w/ ATMStrategyCreate()

    I have reviewed many of the queries regarding the OnOrderUpdate and OnExecution methods, however they all seem to deal with EnterLong() or EnterShort() type of entries. In those scripts, entryorder = EnterLong("id");, uses the entryorder.Token to compare to the Iorder order.Token when an update occurs.

    in the example below.
    How would I monitor the execution and order update for the entry and the closure?

    if(SomethingHappens)
    {
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(Action.SellShort, OrderType.Market, 0, 0, TimeInForce.Day, orderId, ATMStrategy, atmStrategyId);
    }

    if(SomethingElseHappens)
    AtmStrategyClose(atmStrategyId);

    Sleepless in Chantilly,
    Snap

    #2
    OnOrderUpdate() and OnExecution() are for NT entry methods (EnterLong/EnterShort/etc.). They do not work for ATM strategies. To monitor ATM strategies you want to use http://www.ninjatrader-support.com/H...tryOrderStatus
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      So if I am CalculateOnBarClose == true; can I still use these methods and put code inside there and get my results intrabar, as well as enter a new position like on a reverse? I would think so, but maybe not due to internals.

      OnBarUpdate()
      Close position

      OnOrderUpdate()
      if Close order has filled
      AtmStrategyCreate() a new entry
      else wait a while longer for the fill.

      Comment


        #4
        snaphook,

        OnOrderUpdate() does not update on closes from trades managed by an ATM strategy. If you wanted to do something with ATM after a NinjaScript order, you technically can. OnOrderUpdate() is generally used for regular NinjaScript order handling though.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          OnOrderUpdate() and OnExecution() are for NT entry methods (EnterLong/EnterShort/etc.). They do not work for ATM strategies. To monitor ATM strategies you want to use http://www.ninjatrader-support.com/H...tryOrderStatus
          After post #4 I'm not sure what to take away from this discussion. Does the above mean that using any ATMStrategy methods will fail in OnExecute?

          Or would I be able to use IExecution.MarketPosition to capture a long entry from an ATM Create and then use Close and CancelEntryOrder on any short ATMs to be sure they are closed?

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          88 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          48 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          30 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          34 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          68 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X