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:	363
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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          54 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          131 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X