Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Break Even/ChangeOrder

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

    Break Even/ChangeOrder

    Hello AlanP,

    I've got a similar problem. I enabled the TraceOrder and set the Break Even/ChangeOrder prints but it returns 0.


    3 21/12/2021 22:52:00 0
    3 21/12/2021 22:52:00 0
    3 21/12/2021 22:52:00 0
    3 21/12/2021 22:52:00 0
    3 21/12/2021 22:52:00 0
    4 21/12/2021 22:51:24 0
    4 21/12/2021 22:51:25 0
    4 21/12/2021 22:51:26 0
    3 21/12/2021 22:52:00 0

    Script attached.

    Thank you for your tips!
    Attached Files

    #2
    Hi PaulMohn, thanks for writing in.

    This post is in reference to this thread. I moved your question to a new thread since the original thread was from 2018. https://ninjatrader.com/support/foru...lue-printing-0

    I will need more details on this issue you are seeing. The original thread is discussing the use of the MRO method, but I do not see that being used in your script. Can you provide more details on the issue you are seeing? What is printing 0? What line of the script is the print you are showing here?

    Best regards,
    -ChrisL

    Comment


      #3
      Hi ChrisL, thanks for the request.

      More details is the BreakEven and ChangeOrder don't trigger, using Unmanaged Order (lines 105 & 123) and addDataSeries (lines 72 &75) & BarsInProgress (lines 98, 140 & 156).

      The break Even on lines 114 and 133 and the ChangeOrder on lines 150 and 166 print 0 (print statements on lines 117, 137, 154, 170).

      Lines 137 and 154 are showing the previous prints.

      I'm not sure about the use/structure of the BarsInProgress (I've just learned about it to use with the AddDataSeries (lines 72 &75) to get the Current Bid > The Last Bid / Current Ask < The Last Ask - lines 147 & 163).

      Comment


        #4
        HI Paul,

        Our colleague Chelsea made some trailingstop examples in unmanaged here, please reference these examples as they work straight out of the box:



        The unmanaged approach is for advanced programmers who are comfortable making strategies in the managed approach. Consider making your strategy in the managed approach to make it easier to develop. For the change order problem, you will need to add more prints to the strategy to make sure it's being hit and also turn on TraceOrders and look at the Log tab of the control center for any errors.

        Best regards,
        -ChrisL

        Comment


          #5
          Hi,

          Thanks for Chelsea's script, I used some of it. I need the unmanaged approach because the managed approach can't achieve the purpose.

          What more prints are you suggesting in particular? And where to put them? I put prints in 4 places but don't know where else to put them and I still don't know why it's returning zero. The script has TraceOrders enabled but it's not printing. The log tab shows no errors (see snapshot).

          I suspect it is to do somewhat with the multiple BarsInProgress conditions as it's the first time I use it. Can you or Chelsea please have a glance and let me know if that's the issue?
          Attached Files

          Comment


            #6
            Hi Paul, thanks for your reply.

            You can add prints around the ChangeOrder method to make sure it's being hit:

            Print("Changing Order"); //when you see this, we know ChangeOrder has been hit.
            ChangeOrder(initialExitOrderShort, initialExitOrderShort.Quantity, 0, chase1ExitOrderShort0);

            Since they are 0 it most likely means the value is never being set at all. Also, consider making an entirely new strategy that solely focuses on this problem. Get an unmanaged strategy to submit a single order and on the next bar or when a condition becomes true in OnBarUpdate, change the order just to get a feel for how this method works.

            Best regards,
            -ChrisL

            Comment


              #7
              All right thanks for the steps that helps and makes sense. I'll be back asap (tomorrow most likely). A nice day.

              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