Announcement

Collapse
No announcement yet.

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:	379
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.

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          88 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          134 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          119 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X