Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Email for order pending/fill/target/stop

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

    #16
    This is a basic C# concept. The sample is correct because it is only doing one line of code for the if-statement. If you want to do multiple lines of code you need to use brackets.

    Code:
    if (...)
    {
        _____;
        _____;
    }
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      This is a basic C# concept. The sample is correct because it is only doing one line of code for the if-statement. If you want to do multiple lines of code you need to use brackets.

      Code:
      if (...)
      {
          _____;
          _____;
      }

      Over and over again, Josh thx.

      Comment


        #18
        Originally posted by NinjaTrader_Bertrand View Post
        You would need to work with IOrder objects for this, here's a sample demonstrating this - http://www.ninjatrader-support2.com/...ead.php?t=7499

        I don't see anything in there that looks for Target1 or Stop1...

        Comment


          #19
          To clarify, OnOrderUpdate() is not for ATM managed orders.
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_Josh View Post
            To clarify, OnOrderUpdate() is not for ATM managed orders.

            Then it appears to be GetAtmStrategyStopTargetOrderStatus().

            Comment


              #21
              Correct. That will be the method.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_Josh View Post
                Correct. That will be the method.

                Just trying to print to the output window but it doesn't work:

                // Print out some information about the target to the output window
                string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", "idValue");

                // Check length to ensure that returned array holds order information
                if (orders.Length > 0)
                {
                for (int i = 0; i < orders.GetLength(0) - 1; 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());
                }
                }

                Comment


                  #23
                  idValue is likely your variable and not the actual string you are trying to pass in. Same issue as you had before.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_Josh View Post
                    idValue is likely your variable and not the actual string you are trying to pass in. Same issue as you had before.

                    I do have this:

                    private string idValue = string.Empty;

                    I'm not sure why it isn't working.

                    Comment


                      #25
                      Same reason as the error before. You are using quotes when you should just be calling the variable directly.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        Originally posted by NinjaTrader_Josh View Post
                        Same reason as the error before. You are using quotes when you should just be calling the variable directly.
                        Removed the quotes and still does not work.

                        Comment


                          #27
                          Changed it similar structure to the GetAtmStrategyEntryOrderStatus in the SampleAtmStrat:

                          // Check for a pending entry order
                          if (atmStrategyId.Length > 0)
                          {
                          string[,] orders = GetAtmStrategyStopTargetOrderStatus("Target1", atmStrategyId);

                          // Check length to ensure that returned array holds order information
                          if (orders.Length > 0)
                          {
                          for (int i = 0; i < orders.GetLength(0) - 1; 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());
                          SendMail("[email protected]", "[email protected]", "status", orders[i, 2].ToString());
                          }
                          }
                          }

                          In the log highlighted in yellow it says:

                          GetAtmStrategyStopTargetOrderStatus() method error: OrderName 'Target1' does not exist

                          I assumed since my ATM Strategy that is called has 2 targets it would automatically have Target1/Target2/Stop1/Stop2.

                          Comment


                            #28
                            Please try
                            Code:
                            string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyId);

                            Comment


                              #29
                              Originally posted by NinjaTrader_Bertrand View Post
                              Please try
                              Code:
                              string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyId);
                              That is what is already in place, see above post.

                              Comment


                                #30
                                Please try with all caps. "TARGET1"
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                579 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                334 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                101 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                554 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                551 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X