Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on session close Trade vs Code

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

    Exit on session close Trade vs Code

    I may not understand how exit on session close is working, i would appreciate explanation. I have strategy running back test on ES09-22 on 15970 (no mistake) tics.
    Exit time Entry name Exit name
    1/4/2018 16:06 Long Entry Exit on session close
    1/5/2018 13:30 Short Entry Exit on session close
    1/5/2018 16:00 Long Entry Exit on session close
    1/8/2018 14:30 Long Entry Exit on session close
    1/8/2018 16:45 Long Entry Exit on session close
    That is from trades.
    Now i'm using:
    if (Time[0] >= sessionIterator.ActualSessionEnd.AddSeconds(-ExitOnSessionCloseSeconds) && Time[0] <= sessionIterator.ActualSessionEnd)
    So i want to get (emulate) the same as trade does, and i'm not getting even close.

    Questions:
    How i can tap to the same trigger/event as trades are?
    How exit can be in "random" time?

    --PNF
    Last edited by PageNotFound404; 08-05-2022, 07:43 AM.

    #2
    Hello PageNotFound404,

    Thank you for your post.

    ExitOnSessionCloseSeconds is a real-time only property, it will not have any effect on your ExitOnSessionClose time in backtesting processing historical data. However, the times look odd that you're getting for the Exit on Session Close orders. I unfortunately can't get tick data back that far, can you reproduce similar results over the last few days?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Kate W,

      Well... and to avoid any questions: EntriesPerDirection = 1;
      8/3/2022 14:30 Long Entry Exit on session close
      8/3/2022 16:05 Short Entry Exit on session close
      And still question is: outside the code i already posted, is there any way to tap to event?

      --PNF

      Comment


        #4
        Hello PageNotFound404,

        Thank you for your reply.

        Can you reproduce similar results with the built in Sample MA Crossover over the same time period (the last few days)?

        What time zone are you located in?

        Is Break at EOD checked for the data series?

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Hi,
          I'm EST, my time on PC is EST, i do not have any other specific changes.
          Is Break at EOD checked for the data series? - indeed.
          you can do same - select w/e strategy, select ES09-22 select tick and say 15970. I have nothing specific on my PC or install.
          8/3/2022 16:05 Buy Exit on session close
          8/4/2022 13:17 Sell short Close position
          8/4/2022 16:09 Buy Exit on session close
          8/5/2022 10:16 Sell short Close position
          8/5/2022 11:45 Buy Close position
          8/5/2022 13:46 Sell short Close position
          8/5/2022 15:22 Buy Exit on session close
          15:22? Interesting
          Item Value
          Strategy parameters
          Fast 10
          Slow 25
          Data Series
          Start date 7/1/2019
          End date 8/20/2022
          Price based on Last
          Type Tick
          Value 15970
          Tick Replay False
          Trading hours CME US Index Futures ETH
          Break at EOD False
          Setup
          Include commission False
          Label Sample MA crossover
          Maximum bars look back 256
          Bars required to trade 20
          Historical fill processing
          Order fill resolution Standard (Fastest)
          Fill limit orders on touch False
          Slippage 0
          Order handling
          Entries per direction 1
          Entry handling All entries
          Exit on session close True
          Order properties
          Set order quantity Strategy
          Time in force GTC
          --PNF

          Comment


            #6
            Hello PageNotFound404,

            Thank you for your reply.

            In your last post it appears Break At EOD is false. This will need to be set to true (Checked) in order for the bars to end and begin at the correct times - otherwise, the bars will overlap session ending times. Because the Strategy Analyzer uses historical data, and all that is known is the OHLC of the bar, this will cause your Exit at Session Close exits to appear at seemingly random times.

            Please let us know if we may be of further assistance to you.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            56 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            133 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
            45 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