Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Potential Strategy Builder Multiple Entry Bug

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

    Potential Strategy Builder Multiple Entry Bug

    Hello!

    Just looking for a bit of clarification if this is supposed to happen with Strategy Builder custom orders. (OnBarUpdate).
    Works perfectly fine on Playback. Also SIM seems to be pretty solid for the most part. Had it do it a couple of times after 20-30 trades. But on an Apex account, it becomes a much bigger issue.

    Trying to set multiple profit targets on Builder. Not sure if this is just a limitation of submitting custom orders on Builder or possible bug. Made a video that explains what I'm seeing.
    https://drive.google.com/file/d/1OIN...ew?usp=sharing
    • I created a bool so that we only submit the ExitStop and ExitLimit once initially after entering a trade OR once on FirstTickOfBar.
    • Only one of the exit orders is actually updating. Turns the bool false and then we need to wait until a new bar.
    • I can remove that bool all together and it will update after 2 price changes. However, I've noticed this also causes all sorts of issues on live accounts as well. This was done so we only submit the order the least number of times possible and prevent any other errors.
    Maybe I'm just missing something obvious or a better way exists. Would love to see any other examples if they exists.

    Thank you!
    TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

    #2
    Just realized I forgot to attach the script. Here it is if it makes it easier.
    Attached Files
    TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

    Comment


      #3
      Hello TradeSaber,

      Do you see this problem if you instead call the orders on every price change instead of the first tick? Technically, that should be expiring the orders. For them to remain active, you need to call the order method on each OnBarUpdate event, which would be every price change with the current settings.

      Comment


        #4
        Hi Jesse,

        Thank you for your reply. Yes, I've tried it like that in the past. However, that creates further problems with live accounts. I believe any prop with Rithmic experiences this. Likely others as well but this is what I mainly test on.

        If you update the order to the same price, you will get an error. I removed the IsFirstTickOfBar and bool conditions from Set 2 and 4 so that the script to updates on every price change. I get this error almost right away:



        This eventually leads to the yellow stuck orders that cannot be cancelled on the chart until Ninja is restarted.
        Click image for larger version

Name:	image.png
Views:	212
Size:	39.9 KB
ID:	1323622​​​​


        I've had other errors when updating on every single bar update as well like an Atomic Error (Modifying an order in the process of change/fill/cancel). Mainly during trail stops on Builder scripts.


        This is why I went down the road of trying to submit the Exit orders only once per bar. It should run more efficient and not conflict with restrictions other data providers may set. But its just the Exit Order execution, I was not expecting for it to submit them properly sometimes, but delay it other times.


        Not sure if maybe I'm doing something wrong here or if there is a work around for this. Please let me know.

        Thank you for your help!
        TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

        Comment


          #5
          That first screenshot seems to not be showing. Hopefully this one works.

          Click image for larger version

Name:	image.png
Views:	187
Size:	71.0 KB
ID:	1323626

          If the screenshot is still broken after positng this. This is what it says:


          Apex-40613-21, cancellation rejected by the Order Management System - Order is complete. Further cancellations on this order may lead to logoff/disable affected Order. BuyToCover 1 Limit @ 20179.25
          TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

          Comment


            #6
            Hello TradeSaber,

            Yes, in that case with Rithmic, you may need to change to using a manually coded strategy so live until canceled orders can be used instead of having to call the orders on each update. Rithmic provides updates to the platform different than other brokers which can create discrepancies relating to position or other order-related changes in fast-moving markets. It is suggested to manually code strategies with Rithmic, this is important if you are doing more complex tasks using order objects. Do you see the same problems if you use a small timeframe like 30 seconds and OnBarClose processing?





            ​​

            Comment


              #7
              Hi Jesse,

              Thanks again for the reply. You are right about manual coding. I mainly use unmanaged and it makes it much easier to handle various scenarios.
              Was more or less just having fun with Strategy Builder to see how complex we could get with custom orders.

              Ran this one using On Bar Close to test. Funny enough, this one does appear to set all of the exit orders on that bar update. Will try again during RTH just to make sure. The only problem is that now becuase we are waiting for the bar to close, we risk the price turning against us. Had a few instances where this happened and the price moved beyond my intended stop while waiting for the bar to close. Caused an error, and turned the stop orders yellow.

              I think for these custom exits to work properly, it will need to be OnPriceChange or OnEachTick. Not sure if there could be a feature in the future to include IsLiveUntilCancelled for these exit orders directly from builder. It would solve a lot of problems for a lot of people. But I'm sure that comes with a whole new set of complications on your end!
              Or even a way to ensure all of the exits are executed on the same bar update if all of the entries exist.

              Either way, I will mess around with it some more one of these days and see if I can come up with a better solution for this directly from builder.
              Thanks for your help!
              TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              24 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              120 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              63 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              45 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X