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 funk10101, Today, 09:43 PM
          0 responses
          1 view
          0 likes
          Last Post funk10101  
          Started by pkefal, 04-11-2024, 07:39 AM
          11 responses
          36 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Yesterday, 08:51 AM
          8 responses
          44 views
          0 likes
          Last Post bill2023  
          Started by yertle, Today, 08:38 AM
          6 responses
          25 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          24 views
          0 likes
          Last Post algospoke  
          Working...
          X