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 charlesugo_1, 05-26-2026, 05:03 PM
                    0 responses
                    67 views
                    0 likes
                    Last Post charlesugo_1  
                    Started by DannyP96, 05-18-2026, 02:38 PM
                    1 response
                    150 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by CarlTrading, 05-11-2026, 05:56 AM
                    0 responses
                    162 views
                    0 likes
                    Last Post CarlTrading  
                    Started by CarlTrading, 05-10-2026, 08:12 PM
                    0 responses
                    99 views
                    0 likes
                    Last Post CarlTrading  
                    Started by Hwop38, 05-04-2026, 07:02 PM
                    0 responses
                    287 views
                    0 likes
                    Last Post Hwop38
                    by Hwop38
                     
                    Working...
                    X