Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Monitoring Stop Orders on strategies using ATM

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

    Monitoring Stop Orders on strategies using ATM

    Hi,

    Trying to use the method described in http://www.ninjatrader.com/support/h...rgetorders.htm

    I could not find the way to make it work on StopN orders ;

    string[,] orders = GetAtmStrategyStopTargetOrderStatus("STOP1", "idValue");

    // Check length to ensure that returned array holds order information
    if (orders.Length > 0)
    {
    for (int i = 0; i < orders.GetLength(0); i++)
    {
    Print("Average fill price is " + orders[i, 0].ToString());
    Print("Filled amount is " + orders[i, 1].ToString());
    Print("Current state is " + orders[i, 2].ToString());
    }
    }

    How can I get the number of contracts removed and the avg price of Stop1, 2 and 3 ?
    ( Is that possible ? )
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Hi pmaglio,

    Yes, this is possible. Multiple stop and target names are the same for all ATM strategies. You pass in the right name for the order name expected in GetAtmStrategyStopTargetOrderStatus: Stop1, Stop2, Stop3 and Target1, Target2, Target3.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      The trouble is that for "TARGETX" it works fine but for "STOPX" I get always ;

      Average fill price is 0
      Filled amount is 0
      Current state is accepted or working....
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        There could be timing issues if the atm strategy is flat when trying to access. One suggestion is to Print() from OnMarketData()

        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks Ryan,

          Placing the code inside OnMarketData made the trick...

          Now I get the Filled status ;

          for
          (int i = 0; i < orders.GetLength(0); i++)
          Print(CurrentBar+
          ", "+i+", "+orders[i,0]+", "+orders[i,1]+", "+orders[i,2]);
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Accepted
          9703, 0, 0, 0, Working
          9703, 0, 99.21, 1, Filled

          Thanks !
          pmaglio
          NinjaTrader Ecosystem Vendor - The Indicator Store

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          67 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          36 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          59 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          62 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X