Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAtmStrategyStopTargetOrderStatus()

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

    #16
    NT_Jesse,

    Here are the non-compiled .cs files:NTReview.zip

    Comment


      #17
      The HelpGuide shows that the name for the order should be in all caps. Have you tried that in its place?

      "STOP1"

      http://www.ninjatrader.com/support/h...rgetorders.htm

      Also, you can check the order name in the Orders Tab of the Control Center for more clarity on its name

      Comment


        #18
        Calonious,

        Yes, I have tried using STOP1 as well and it still reported an error message. Thank you for the suggestion though.

        Comment


          #19
          Ok I tested the script to see what you are getting.

          I am assuming it is this message -
          Code:
          ---------------------BEGIN TRADE INFO----------------------
          LONG POSITION -+- 
          The entry order average fill price is: 0
          The entry order filled amount is: 0
          The entry order order state is: PendingSubmit
          The RSI value when the trade entered was: 20.4841419642105
          Order ID is: a27c0a5b9b0f43c9bb38a4e9484315cc
          atmStrategyId is: bff81e952c8d49219bd2491998d8b545
          ---------------------END TRADE Entry INFO----------------------
          [B]**NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist[/B]
          The entry order average fill price is: 1245.25
          The entry order filled amount is: 1
          The entry order order state is: Filled
          The RSI value when the trade entered was: 21.8789957867447
          Order ID is: a27c0a5b9b0f43c9bb38a4e9484315cc
          atmStrategyId is: bff81e952c8d49219bd2491998d8b545
          ---------------------END TRADE Entry INFO----------------------
          Average fill price is 0
          Filled amount is 0
          Current state is PendingSubmit
          If that is the case I would expect that bolded error message in this case. The Stop and Profit targets haven't been created yet since the Entry Order is in a pending submit state. You can see after the second END TRADE line that the Stop info is brought up correctly in its pending submit state.

          If this isn't it, can you clarify more on what exactly it is you are seeing?

          Comment


            #20
            Hi Calonious - thank you for looking at the code I provided.

            It looks like the code is working successfully for you, which creates a bigger question for me - why isn't it working on my machine? The reason I say this is that my code always provides the GetAtmStrategyStopTargetStatus() method error, I never have a chance to see the stop loss information that is supposed to print to the Output window. But you are able to successfully view it..., is there a cache I need to delete or other tip I don't know about?

            Here is my output for several trades generated by the strategy:

            **NT** Submitting order with strategy 'ForNTReview/d49fbabb11d5487d884d6150560397b4'
            ---------------------BEGIN TRADE INFO----------------------
            LONG POSITION -+-
            The entry order average fill price is: 2043
            The entry order filled amount is: 1
            The entry order order state is: Filled
            The RSI value when the trade entered was: 29.3232968012914
            Order ID is: 218596373e894b46852e02402e22e10e
            atmStrategyId is: 245c135e1bd0439ba053c3b7d76630ef
            ---------------------END TRADE Entry INFO----------------------
            **NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist
            Strategy id reset has taken place.
            **NT** Submitting order with strategy 'ForNTReview/d49fbabb11d5487d884d6150560397b4'
            ---------------------BEGIN TRADE Entry INFO----------------------
            SHORT POSITION - Winning Move*(((
            The entry order average fill price is: 2047.25
            The entry order filled amount is: 1
            The entry order order state is: Filled
            The RSI value when the trade entered was: 72.7160647396992
            Order ID is: d7626224ffa4402fb4c232775c1569a2
            atmStrategyId is: 55ff453db4964078b1ac882b7c89ff23
            ---------------------END TRADE Entry INFO----------------------
            **NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist
            Strategy id reset has taken place.
            This output with the same method error continues for every trade thereafter. Any help is greatly appreciated.

            Comment


              #21
              The only thing that I probably did different was that I had to create a new ATM strategy template. I put in large values between the Stop and Profit so they wouldn't get filled immediately.

              The first thing that pops into my mind when seeing your logging is that the Stop or Profit might be getting filled out early but if they are still active and running on the either Orders Tab or in a Chart then try using another ATM Strategy like I did. Another good tip for debugging is throw in some time stamps with those prints I like to use Time[0] with that as it will give me the bar time of when that print was called.

              Try those out. If your still lost then we can let support jump here and see what they dig up

              Comment


                #22
                Thank you for the tips Calonious, I'll work through your suggestions.

                Comment


                  #23
                  NT Support Requested

                  Ninja Trader Jesse,

                  I worked through Calonious's suggestions and other ideas I had and received the following results:

                  1. created new strategy template - error still received
                  2. created new ATM-Strategy-Template - error still received
                  3. added Stop strategy template name instead of using "Stop1", in this case it's "CodeTest" - error still received
                  4. Restarted Computer - error still received
                  5. Shutdown/Turnon Computer - error still received

                  **NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist

                  The following is a screenshot from the executions tabs, showing that Stop1 is used to capture trade exit data.

                  Click image for larger version

Name:	GetAtmStrategyStopTargetOrderStatus - Executions Tab Screenshot .png
Views:	1
Size:	19.7 KB
ID:	873600

                  Also, here is the modified code that uses the Time[0] variable to aid when an entry/exit occurs. ForNTreview2.zip

                  Thank you in advance

                  Comment


                    #24
                    Hello AlienKnowledge,

                    Thank you for your response.

                    I receive the same messages as you when I test the NinjaScript strategy. This occurs as the strategy is not properly reversing it's positions, I would recommend reviewing the strategy at the following link to properly reverse your ATM Strategies: http://www.ninjatrader.com/support/f...d=5&linkid=615

                    I added in the code for GetAtmStrategyStopTargetOrderStatus() and it works correctly in the SampleAtmStrategyReversal strategy.

                    Comment


                      #25
                      OK I will review - thank you

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      77 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      45 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      27 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      32 views
                      0 likes
                      Last Post TheRealMorford  
                      Started by Mindset, 02-28-2026, 06:16 AM
                      0 responses
                      63 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X