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

3 months of 20 ticks/bar chart to load??

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

    3 months of 20 ticks/bar chart to load??

    Hi, let us suppose that:

    - I use a 20 ticks/bar chart.
    - I only need 500 bars on my chart.
    - I need to add an indicator, for example, a line showing the last 3 months higher high.
    - This indicator data is only changed at the end of day (rolling 90 days period).

    Questions :

    1) On my ticks chart, in "Data Series" menu, would I need to change the time frame from 500 bars to 90 days (= 3 months) to load in order to be able to see this indicator line?? This is very CPU + disk hungry, imagine, 3 months of 20 ticks/bar chart to load, especially if you need several charts...

    2) What is the best way to code this indicator in order to save CPU + disk time on this tick chart?

    Thanks!
    Last edited by vindiou; 09-22-2018, 10:04 AM.

    #2
    Hello vindiou,

    When calling AddDataSeries() this does add the same number of bars or same number of days as the primary series.

    This means for 90 days of daily bars, you would also need to load 90 days of tick data.


    The only current work around is to call data out of sync (with the primary series) with a BarsRequest. While a BarsRequest does allow for any arbitrary amount of data for different bar types and intervals, the major limitation with this is that data returned as a Bars object cannot be supplied as the input series parameter to an indicator call.

    It would be more work to do, but if you were to take the logic from any indicators this data might be passed to and write it in the host script directly you could process that data with custom methods within the host script. Thus this would allow for a small amount of tick data to be called with a BarsRequest, that data be processed in a custom method, and this then used in the rest of the script as needed.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea (or anyone),
      I would be very grateful if you could give me a quick code example, a skeleton.
      I have unsuccessfully tried to understand how would BarsRequest work in my case...
      Thanks

      Comment


        #4
        Hello vindiou,

        Below are links to a few examples of using a BarsRequest to get out of sync data.


        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chartchart, 05-19-2021, 04:14 PM
        3 responses
        577 views
        1 like
        Last Post NinjaTrader_Gaby  
        Started by bsbisme, Yesterday, 02:08 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by prdecast, Today, 06:07 AM
        0 responses
        3 views
        0 likes
        Last Post prdecast  
        Started by i019945nj, 12-14-2023, 06:41 AM
        3 responses
        60 views
        0 likes
        Last Post i019945nj  
        Started by TraderBCL, Today, 04:38 AM
        2 responses
        18 views
        0 likes
        Last Post TraderBCL  
        Working...
        X