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 rocketman7, Today, 01:00 AM
          0 responses
          1 view
          0 likes
          Last Post rocketman7  
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          27 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 04-23-2024, 09:53 PM
          2 responses
          74 views
          0 likes
          Last Post wzgy0920  
          Started by Kensonprib, 04-28-2021, 10:11 AM
          5 responses
          193 views
          0 likes
          Last Post Hasadafa  
          Working...
          X