Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Non-Trading Days on Multiple Timeframe Chart

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

    Non-Trading Days on Multiple Timeframe Chart

    Hi All,

    I have an indicator I am working on that requires intraday data that I want to see over a daily timeframe. So I am using a multi timeframe chart (daily & minute data together). To get the intraday data, I load in historic minute data. But, I am having an issue with the chart showing non-trading days (no data is shown for these days as expected). So I don't know if this is because of loading historic data, or because its a multi timeframe chart. But my question is, is there a way to eliminate these non-trading days from the chart?

    Thanks,

    Lee

    #2
    Hello Lee,

    Thank you for your note.

    The historical will not display any data for days there was no data. However, you would need to include logic into your script that would tell the strategy to skip these particular days. More than likely using the DateTime Structure.
    http://www.dotnetperls.com/datetime-format
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,

      Thanks for the input. I am using the DateTime command, but not sure how to tell it to ignore days without data... I would have thought that it would not call on any day that has no data?

      Here is my actual script. Maybe you can help provide some insight on where I would need to modify to avoid this.

      Regards,

      Lee
      Attached Files

      Comment


        #4
        Lee,

        The script is going to read each bar that you have it attached to the chart.
        If on the non-trading day there is no data then the script won't read any data or bars from that day and would work off the last known bar from the session before.

        However, as a reference for a date time check

        if(Time[0].Date == new DateTime(2014, 1, 1))
        return;
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal,

          Now I'm a little confused... In your initial post you said I would need to make sure that I include logic into the script to ensure that it skips days with no data. But in your last response, you said on non-trading days, it won't read any data. So if there is no data for the non-trading days, will they still show? I'm trying to understand if this is a problem with the script or something else?

          Thanks,

          Lee

          Comment


            #6
            Hi Lee, there will be multiple scenarios at play here depending on the holiday you see happening, as some have just shorter sessions and other simply no trading at all. NinjaTrader is completely event based, so if you there's no trading then no bars would be generated and OnBarUpdate() would not be called then. You will still see empty periods on MultiSeries charts, as in this environment you are forced to use non equidistant bars.

            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi Bert,

              Ok, so correct me if I'm wrong, but with a multi-timeframe chart setup (days & minutes), you are forced to use non equidistant bars. Therefore, I'm going to see empty days on the chart...

              This seems simple enough. Thank you for the response and explanation.

              Regards,

              Lee

              Comment


                #8
                Your understand is correct Lee, that's a visual item to keep in mind working with non equidistant bars in general.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Today, 06:40 PM
                0 responses
                2 views
                0 likes
                Last Post algospoke  
                Started by maybeimnotrader, Today, 05:46 PM
                0 responses
                6 views
                0 likes
                Last Post maybeimnotrader  
                Started by quantismo, Today, 05:13 PM
                0 responses
                6 views
                0 likes
                Last Post quantismo  
                Started by AttiM, 02-14-2024, 05:20 PM
                8 responses
                168 views
                0 likes
                Last Post jeronymite  
                Started by cre8able, Today, 04:22 PM
                0 responses
                8 views
                0 likes
                Last Post cre8able  
                Working...
                X