Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade seems to miss being executed and ends up one bar late

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

    Trade seems to miss being executed and ends up one bar late

    I plotted a red dot on the char corresponding to the Short Entry, however, the arrow points to bar where the trade was not taken. The red dot corresponds to other trades that were all taken correctly before and after. I am using Volume bars, Tick Replay is NOT enabled, I am using the continuum connection and running it in real time ( this bar is a couple days old ). Note I hardcoded the bar to make a trade and only the EnterShort() worked as all stop and limit entries skipped the bar. What am I missing about how trades are calculated in this particular scenario? Thanks.

    #2
    Hi faalbue, thanks for posting. Strategies that run OnBarClose will execute on the first tick of the next bar. If you need to execute the order on the exact tick then Calculate must be set to OnEachTick.

    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks Chris L for the reply. However, how come the next bar with the dot it gets executed but not the bar with the arrow? later to the right there are a couple other red dots that executed on the next bar....

      Comment


        #4
        Hi faalbue, thanks for your reply.

        The drawing dot will draw on the bar index you provide in its parameter list. The concept still holds that any order placed on the bar close will be made on the first tick of the next bar.

        Kind regards,
        -ChrisL

        Comment


          #5
          Yes Chris ... that is what I expect....if the code I draw the dot on the current bar and add and entershortstopmarket if looking to go short then plot dot, entershortstopmarket ...

          I would expect the order to be filled on the next bar, however, it is not filled. I event put in code to hard code specific bar with the dot....and on that bar I do all 4 entry short type signals.. ... stop market, limit, etc.....only EnterShort() actually enters on the next bar at open as you would expect....but clearly, on the first bar with the dot, the next bar hit the stop...but an entry is not made...

          On that next bar, I have the same logic since i did not get into the market...so the bar that missed the trade I paint a DOT and EnterMarketStopShort and on the very next bar the trade gets entered correctly....

          So to sum up the issue....on the bar with the dot, I EnterShortStopMarket at the price where the current dot was printed....clearly the next bar hits the stop and a trade should occur...it doesn't so
          the next bar with the same logic print the dot and entershortstopmarket and that executes successfully...

          Why did it not work on the one bar and not the previous bar....'

          This is not an issue about tick data I do not believe....and I understand that on the bar close a dot prints and on the first tick of the next bar a entershortstopmarket ...clearly the bar goes thru the stop price ( the previous bars red dot ) however a trade does not occur. ...

          Comment


            #6
            I figured out the issue...For managed trades the trade to the short side was being ignored for that bar.....due to another order while flat....From the documentation under managed trades:



            Methods that generate orders to enter a position will be ignored if:

            •A position is open and an order submitted by a non market order exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction

            •A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction

            •A position is open and two or more Entry methods to reverse the position are entered together. In this case the second Entry order will be ignored.

            •The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction

            •The entry signal name is not unique


            Thanks.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            72 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            43 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            25 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            28 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            58 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X