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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          656 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          371 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          579 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X