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 llanqui, Today, 03:53 AM
          0 responses
          6 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          10 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          15 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
          14 views
          0 likes
          Last Post strategist007  
          Working...
          X