Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X