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

Problems with orders working with Calculate.OnPriceChange

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

    Problems with orders working with Calculate.OnPriceChange

    Hello. I create an strategy:
    It works calculating OnPriceChange,
    applied to a range bars chart, with ES futures .
    I have problems with orders.
    when I am short, for example, if appears the condition to enter long position,
    depending on the Close[0] position related to the entry price,
    I send EnterLongLimit(1, epc) or EnterLong(1).

    When is sent the order EnterLong(1),
    I hope that this order closes the short position and open a long position ( entering at market), but it doesn´t occur in many bars.
    The same with long positions, EnterShort(1) order doesn't work as it should.

    ¿Why doesn't work this EnterLong(1) or EnterShort(1) orders when Close[0] is in a level to enter at market?

    I sent the strategy code with clear explanations for entries and exit conditions and price levels to summit different orders.

    Hoping for your answer , thanks a lot.

    Attached Files

    #2
    I send an image showing the problem
    Attached Files

    Comment


      #3
      again Click image for larger version

Name:	directionMerrors.PNG
Views:	287
Size:	32.5 KB
ID:	1088334
      Attached Files

      Comment


        #4
        Hello Parmenides48,

        Thanks for your message.

        Please be sure to rule the Internal Rules of the Managed Approach. Stop and Limit orders that are submitted to exit a position will be ignored if an entry order is placed in the opposite direction.

        We would recommend adding prints to your code to verify your strategy logic is becoming true and allowing these order methods to be reached.

        We also recommend testing the strategy with TraceOrders enabled so you can confirm the order methods are submitting the orders, receiving valid parameters, and are not being ignored due to an internal rule.

        Managed Approach Internal Rules - https://ninjatrader.com/support/help...antedPositions

        Debugging tips - https://ninjatrader.com/support/help...script_cod.htm

        Trace Orders - https://ninjatrader.com/support/help...aceorders2.htm

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          thanks for your answer,
          I am working on your recomendations.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by martin70, 03-24-2023, 04:58 AM
          15 responses
          114 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by The_Sec, Today, 02:29 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by jeronymite, 04-12-2024, 04:26 PM
          2 responses
          31 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by Mindset, 05-06-2023, 09:03 PM
          10 responses
          265 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by michi08, 10-05-2018, 09:31 AM
          5 responses
          743 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X