Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add LastTickOfSession to Close Bars at end of day

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

    Add LastTickOfSession to Close Bars at end of day

    One engineering decision made by the NT team is not to end the bar till the first tick which belongs to the next bar arrives. This is in synch with NT's over all system design where the first tick triggers various function call backs etc.

    However for people doing end of day processing this is a big pain. Unless they set CalculateOnBarClose to false, they do not get the latest day's statistics on their charts. You could set CalculateOnBarClose to false but then you will end up with a lot of unneeded calculations being performed. You can not filter that with the FirstTickOBar since that tick never arrives till the next day. For Friday's and weekly bars, this means the first tick on Monday.

    With support for sessions in NT7, I think it is time for NT to generate an artificial LastTickOfSession which reports the last price and occurs when the session ends. For all charts tied to the session this will close the current bar and trigger the OnBarUpdate function which can now be used to do EOD processing.

    NT is doing the processing to figure out when the session is ending to stop feeding data to the char and when to start feeding data to the chart again when the next session starts. So adding this virtual tick should not require a major architectural overhaul.

    Since this special tick will be qualified as the LastTickOfSession any indicator or strategy which would potentially mess up can filter it out.

    If backward compatibility for indicators based on existing architecture is affected, NT could add a OnLastTickOfSession function which can be overridden locally in indicators to do endofsession processing. For most indicators this should just trigger the OnBarUpdate function call. In cases where the distinction between the current implementation of the first tick of next bar and the new LastTickOfSession is important, the user can ignore it (not override the OnLastTickOfSession function) or write something custom to handle the situation.

    #2
    Hello,

    I will send this to our development department for consideration, thanks!
    DenNinjaTrader Customer Service

    Comment


      #3
      aviat72,

      This is the exact same event as FirstTickOfBar. All you have to do is check FirstTickOfBar and then back reference [] indexes by 1 so to get the just closed bar you can go [1] instead of [0].
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Josh

        The issue is of the time when the FirstTickOfBar is sent not the tick itself.

        Right now it is not sent until the next bar starts. What I want is a tick which is sent when the session ends instead of the next session start.

        On a daily chart that can mean the next day. Any EOD of indicators which are supposed to work on BarClose are not triggered till the next days starts. The workaround is to operate them with OnBarClose=false which is a performance hog.

        From an end user perspective having to wait for the next day to trigger end of bar calculations is very cumbersome. That is why a special solution tick which allows for backward compatibility while triggering EOD calculation might work.

        Comment


          #5
          aviat72,

          This is expected. Closing of a bar is exactly the same event as the opening of the next. The closing of a bar is only done when a new bar starts.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Josh View Post
            aviat72,

            This is expected. Closing of a bar is exactly the same event as the opening of the next. The closing of a bar is only done when a new bar starts.
            Josh

            What I had suggested above was an enhancement which is backward compatible with the expected behavior based on engineering design while providing the required functionality based on real-world needs.

            I hope you realize that Time based bars not closing till the next tick arrives is inconsistent with the functional requirement. From a functional perspective the bar should close as soon as the bell rings.

            From an engineering implementation point of view I can understand why you chose the tick arrival time as the trigger to close bars. However this engineering driven constraint imposes severe functional penalty. Having a daily Friday bar not close till the Monday morning is really awkward.

            Providing the OnLastTickOfSession() function will allow users to do their EOD calculations in their indicators when they need to do it based on their real-world needs; i.e. EOD instead of start of the next day. And it will be backward compatible with existing NT architecture.

            I have some indicators which use market internals data. I want to use them for EOD analysis of the market. However, because the daily bar does not close till the next day these indicators do not work as you would expect.

            I want to be able to build a bigger system on top of the smaller building blocks. The inability to do end of day calculations after market close artificially limits what I can achieve without having to put in artificial hacks everywhere.

            Adding another callback function which is triggered when the Session Ends (time wise) will help users work around these architectural limitations.

            Comment


              #7
              Understood. This is on our feedback list. Thanks.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                It's been two years. I'm looking for this now. Has this been added to NT?

                Comment


                  #9
                  Hello,

                  There has been no changes at this time in this area.

                  Best solution is to use a time filter and trigger ani action at a specific time using this sample.



                  Let me know if I can be of further assistance.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rdtdale, Today, 01:02 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post rdtdale
                  by rdtdale
                   
                  Started by alifarahani, Today, 09:40 AM
                  3 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by RookieTrader, Today, 09:37 AM
                  4 responses
                  18 views
                  0 likes
                  Last Post RookieTrader  
                  Started by PaulMohn, Today, 12:36 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post PaulMohn  
                  Started by love2code2trade, 04-17-2024, 01:45 PM
                  4 responses
                  41 views
                  0 likes
                  Last Post love2code2trade  
                  Working...
                  X