Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to plot a chart which starts from the the current day's market opening

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

    How to plot a chart which starts from the the current day's market opening

    Hi. I am using M6E instrument (time zone is UTC+09:00) and I am having a problem with the chart that is being plotted. Despite adjusting the setting of no. of days to load as 0, I still get the chart plotting with the previous day's data. What should I do to plot a chart starting from the start of today's market opening (around 7 a.m. here)? Does it have something to do with the session template?

    #2
    Originally posted by mbesha View Post
    Hi. I am using M6E instrument (time zone is UTC+09:00) and I am having a problem with the chart that is being plotted. Despite adjusting the setting of no. of days to load as 0, I still get the chart plotting with the previous day's data. What should I do to plot a chart starting from the start of today's market opening (around 7 a.m. here)? Does it have something to do with the session template?
    Explicitly set the "Start date" by changing "Load data based on" to "CustomRange".

    Comment


      #3
      Feedback

      Thanks but I tried and it didn't work.

      Comment


        #4
        Originally posted by mbesha View Post
        Thanks but I tried and it didn't work.
        Well, then, your NT must be different from mine. My picture below clearly shows my day starting at the first 5-minute bar and ending at 1615 ET, with nary a bar before my session starts.
        Attached Files

        Comment


          #5
          I wish I had a chart like that. My guess is that my NT is the same as yours so the rot cause of the problem must lie elsewhere

          Comment


            #6
            Hello mbesha,

            This is going to be due to the Default Session Template that the M6E is using. It is using the CME FX Futures ETH, which is a defines the overnight session of the instruments. So when NinjaTrader is loading up the instrument it will load data for the entire session that is valid at those given times. If you would like to view only data for an individual day you may want to create a session template that is going to display the hours that you would like to view for each individual day and the time zone that you are in.

            You may view/edit/create session templates in the Session Manager window. You can access the Session Manager by going to Tools > Session Manager. Below is a link to the Session Manager section of our help guide.

            * http://www.ninjatrader.com/support/h...on_manager.htm

            Attached is an example of this using an Eastern Time zone computer, but you may want to change your to the Time zone your computer is currently set to.
            Attached Files
            JCNinjaTrader Customer Service

            Comment


              #7
              Still experiencing problems limiting the data displayed to only one trading day

              I tried creating my own session template so as to only display the data for one trading day but I still get data for two days. I have attached screen shots of what I am talking about. From the screen shot of the chart, you can clearly see the end of the first trading day (as shown by the arrow) and yet the data of the next trading is still being displayed. I have also attached the time settings of the chart and the session template I am using.

              Could this problem have anything to do with the fact that the chart uses line break (tick) as the data series? Since this data series is time-independent, a single bar can be created from anything ranging from a second to hours even.

              Please advise.
              Attached Files

              Comment


                #8
                Hello mbesha,

                This is because your Session Template include an overnight session.

                When you have a date set inside of your Chart NinjaTrader will take all sessions that are going to display for that day and display them fully meaning that since the two sessions are going to be displaying on one day NinjaTrader will load them both up.

                If you wanted to see only one you will want to define one from Sunday To Sunday and Monday to Monday.

                Also make sure that the Session Time zone matches your local PC time zone.

                Let us know if that helps.
                JCNinjaTrader Customer Service

                Comment


                  #9
                  Let me see if I got you right...

                  So am I to understand that since one session crosses over from one day into the next under my current session template, the chart will display the data for the 2 days i.e two trading sessions? I tried the suggestion you gave me (to set the parameters of the sessions template between one midnight and the next) but this ends up truncating some of the data for the session because a session starts and ends just before 7 a.m. here. So is there no possible way of plotting the data for just 1 session because it spans across two literal days? I am asking this because I am using an automated custom strategy to execute my trades and it is designed such that it only works correctly if the data it is fed with is from the start of one session to its end. If it is impossible to chart the data as per my request, could you then advise me on how I can set my custom strategy to only execute within one session ( even though the chart were to plot 2 sessions under my current session template, I would like the custom strategy to execute only within the limits of the start and end of one session). Thanks.

                  Comment


                    #10
                    Originally posted by mbesha View Post
                    ... I am asking this because I am using an automated custom strategy to execute my trades and it is designed such that it only works correctly if the data it is fed with is from the start of one session to its end. If it is impossible to chart the data as per my request, could you then advise me on how I can set my custom strategy to only execute within one session ( even though the chart were to plot 2 sessions under my current session template, I would like the custom strategy to execute only within the limits of the start and end of one session). Thanks.
                    It looks then like you need to reset your data at FirstBarOfSession. ref: http://www.ninjatrader.com/support/h...rofsession.htm

                    Comment


                      #11
                      Hello mbesha,

                      Correct, this is a limitation inside of NinjaTrader 7, we are looking at reworking how Sessions are handled in the next major release of NinjaTrader.

                      With that said, you may want to add some checks as Koganam stated so that you can filter out data that you do not want to see.

                      You may also use the GetNextBeginEnd() to get the session start and end date time to help filter it as well.



                      Happy to be of further assistance.
                      JCNinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by koganam View Post
                        It looks then like you need to reset your data at FirstBarOfSession. ref: http://www.ninjatrader.com/support/h...rofsession.htm
                        Thank you Koganam for the hint. If it is not too much to ask, could you or NinjaTrader_JC give me a simple example of how to use the FirstBarOfSession to reset the data or strategy? I have been unable to find any examples on how to use it in such a scenario and I am not too sure how to go about doing this. Thanks in advance.

                        Comment


                          #13
                          Hello mbesha,

                          Here is an example of how to filter out data:

                          Code:
                          private bool firstSession = true;
                          
                          protected override void OnBarUpdate()
                          {
                          
                          //Since by default BarsRequired is 20 the FirstBarOfSession is not going to be true
                          // but we can check the for the next session to stop the strategy from calculating.
                          if(Bars.FirstBarOfSession)
                          {
                          	firstSession = false;
                          }
                          			
                          			
                          if(firstSession)
                          {
                              //Do something...
                          }
                          }
                          Let me know if this helps.
                          JCNinjaTrader Customer Service

                          Comment


                            #14
                            Thanks for the example. It proved useful.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Waxavi, Today, 02:10 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Started by TradeForge, Today, 02:09 AM
                            0 responses
                            11 views
                            0 likes
                            Last Post TradeForge  
                            Started by Waxavi, Today, 02:00 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Started by elirion, Today, 01:36 AM
                            0 responses
                            4 views
                            0 likes
                            Last Post elirion
                            by elirion
                             
                            Started by gentlebenthebear, Today, 01:30 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post gentlebenthebear  
                            Working...
                            X