Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit on close exit >> open position next day pre open

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

    #16
    Thanks for all the input Alex, I'll test this here on our end - I'm curious, if you change to ExitOnClose = false and use a TIF setting of GTC - would the issue still appear on your end?

    Comment


      #17
      hi bertrand

      i always use tiff = GTC + i tried exitonclose = false + same problem.

      alex

      Comment


        #18
        Alex, when I submit specifically to the primary BarsInProgress I don't see the issue :

        EnterLongLimit(0, false, 1 , Close[0], "LongLmt");

        Also setting liveUntilCalled explicitly to false here.

        Can you please try this on your end as well?

        Thanks,

        Comment


          #19
          hi bertrand

          i just tried this + it still creates the spurious order.

          same whether liveuntilcancelled true or false.

          also to clear up a bit set

          if (BarsInProgress == 0 && Position.MarketPosition == MarketPosition.Flat && Time[0].Date == date.Date && Time[0].TimeOfDay == date.TimeOfDay)

          before enterlonglimit (...)

          notice timeofday == not the > previously

          so make sure a minute timeframe + session start that will ensure 11.00 am trade. or can change the date variable.



          Comment


            #20
            Thanks Alex, I'll give this a try as well - to clarify in your testing you submit directly to the primary series correct, so for example EnterLongLimit(0, false, 1 , Close[0], "LongLmt1");

            Comment


              #21
              hi bertrand

              yep i set limit exactly as u said for primary series

              alex

              Comment


                #22
                Was finally able to reproduce it here on my end now, we will look into it and get back to you.

                Comment


                  #23
                  Is there a way to enable the ExitOnClose only in Friday?

                  Comment


                    #24
                    Edward, for backtesting you would need to custom code to recognize the DayOfWeek == Friday and then issuing the needed ExitLong / ExitShort orders for your script.

                    For realtime trading, you could control of course each day you activate the strategy how ExitOnClose is set.

                    Comment

                    Latest Posts

                    Collapse

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