Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Exiting position over bought and placed me back into trade?

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

    Exiting position over bought and placed me back into trade?

    Hello,

    Today I was in a short on the ES with 2 contracts. I use an automated strategy that I had/am having developed. My programmer won't get back to me until Monday so I wanted to see if I could get a head start on this by asking here.

    The price action hits the profit target (MIT) but for some reason bought to cover 3 contracts despite being in a 2 contract short position, which means I was then in a long position. What would cause this?

    I had this same strategy running on another chart and all the orders filled exactly as they should.

    Is this a strategy error/bug or something else?

    I've attached the log.

    Click image for larger version  Name:	image.png Views:	1 Size:	7.5 KB ID:	1273946
    Last edited by StrongLikeBull; 10-21-2023, 09:13 PM.

    #2
    any ideas?

    Comment


      #3
      Hello StrongLikeBull,

      Thanks for your post.

      What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)​

      Are you using Exit order methods or Set methods for the stops/targets in the script?

      Or, does your strategy use both Exit methods and Set methods?

      Does your strategy call Entry order methods and Exit order methods in the same condition in the script?

      Have you added debugging prints to the strategy to understand exactly how it is behaving and placing orders?

      If not, add prints in the strategy (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

      Also, enable TraceOrders to track orders placed, amended, and canceled and see how they are behaving. The traces display in the NinjaScript Output window.

      ​​​​​​Below is a link to a forum post that demonstrates how to use prints to understand behavior.
      https://ninjatrader.com/support/foru...121#post791121
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_BrandonH View Post
        Hello StrongLikeBull,

        Thanks for your post.

        What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)​

        Are you using Exit order methods or Set methods for the stops/targets in the script?

        Or, does your strategy use both Exit methods and Set methods?

        Does your strategy call Entry order methods and Exit order methods in the same condition in the script?

        Have you added debugging prints to the strategy to understand exactly how it is behaving and placing orders?

        If not, add prints in the strategy (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        Also, enable TraceOrders to track orders placed, amended, and canceled and see how they are behaving. The traces display in the NinjaScript Output window.

        ​​​​​​Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121
        8.1.1.7 64-bit

        Unfortunately I have no idea the answers to the rest of your questions.

        I think the better question would be, why did the same strategy running the same settings and parameters close out of the same exact trade fine on another chart (but same instrument and candle) but this one didn't?

        Comment


          #5
          Hello StrongLikeBull,

          Thanks for your notes.

          Ultimately, debugging steps would have to be taken to understand exactly how the strategy behaved and placed trades on the chart. Since the script is not created by NinjaTrader we cannot say for certain how the logic in the script is working.

          Your developer could add debugging prints to the script and test it to see exactly how their logic in the script is behaving when orders are being placed. This will allow them to narrow down the behavior to see what exactly in the code could have caused this behavior.

          If the developer has questions about debugging their logic, they could contact support[at]ninjatrader[dot]com.
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Taddypole, 04-26-2024, 02:47 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Started by futtrader, 04-21-2024, 01:50 AM
          6 responses
          58 views
          0 likes
          Last Post futtrader  
          Started by sgordet, Today, 11:48 AM
          0 responses
          4 views
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by Trader146, Today, 11:41 AM
          0 responses
          5 views
          0 likes
          Last Post Trader146  
          Started by jpapa, 04-23-2024, 07:22 AM
          2 responses
          22 views
          0 likes
          Last Post rene69851  
          Working...
          X