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

Changing Data Series On Chart

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

    Changing Data Series On Chart

    Hi All,

    I have noticed that when I set a custom data range on my charts, it will maintain the same number of days (span) for the series. But the reason I use the custom range is to maintain the same start date. It will update the end date, but then changes the start date to maintain the same span. I don't know if this is a bug, or if there is a setting I can change, but this is not what I want for my strategy. I want the start date to remain fixed and the end date to update to the current day as it already does.

    Is there a way to fix this? Am I doing something wrong? If there is a way to ensure the strategy overrides the chart and always starts on a specific date, I'm ok with taking that approach too.

    Any help would be greatly appreciated.

    Thanks,
    Lee

    #2
    Hello lee612801,

    Thank you for your note.

    This would be expected behavior, as range is going to keep the same number of bars (range), but shift them over on each new bar.

    I can put in a feature request to have the start date fixed per your request.

    Is this for visual purposes only?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan

      Thank you for the response. This is not just for visual purposes, I use it for my strategies. I would appreciate if you could put this in as an enhancement request.

      Thank you,

      Regards,
      Lee

      Comment


        #4
        Hello lee612801,

        I will put in the request.

        Regarding the strategy calculation, you could probably use a list to replicate what a fixed start date would do in this case.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi Alan,

          Can you elaborate a bit more on this list?

          Thanks,
          Lee

          Comment


            #6
            Hello Lee,

            A list would be like an array but more flexible as you can amend its size. Whatever calculation is being influenced by the start day being shifted over could easily be worked around by using a list, by just adding data to a list. The start of the list would be the start of the custom date you’d prefer didn’t shift over. The list would expand over time.

            I have provided a link to C# lists,
            Create a new List, add elements to it, and loop over its elements with for and foreach.


            As well as to a sample I use which involves a list,


            Another,


            If you’d like to share more detail on what issue you are having with the calculation, I could try to offer some assistance.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Hi Alan,

              Thank for the info. This seems to be an interesting method to maintain the start date. I will review and let you know if I have any questions.

              Thanks again,
              Lee

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by WeyldFalcon, 12-10-2020, 06:48 PM
              14 responses
              1,428 views
              0 likes
              Last Post Handclap0241  
              Started by DJ888, 04-16-2024, 06:09 PM
              2 responses
              9 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              41 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              2 responses
              16 views
              0 likes
              Last Post bill2023  
              Working...
              X