Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader takes much memory tick data

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

    NinjaTrader takes much memory tick data

    Dear support,

    I have small technical problem with NinjaTrader strategy and hope you will help to solve it.
    PreCondition: CalculateOnBarClose = false
    What should be done: price should cross WMA(period = 89 days) and enter the position.
    What I am trying to do:
    Code:
    Add(PeriodType.Tick, 1);    //ticks for detection of crossing
    Add(PeriodType.Day, 1);    //for WMA indicator
    then

    Code:
    if (CrossBelow(Closes[1], WMA(BarsArray[2], WMA_period)[0]) ...
    // and so on
    Pay attention that I am trying to detect real time crossing of daily WMA(89), not at bar close.

    What I receive:
    NinjaTrader loads tick data too much time. I think it tries to load tick data for all 365 days that on the chart. So as a result I see that NinjaTrader hangs and takes too much memory ( about 1.7 Gb)

    Could you please advice me how to avoid such situation and make my strategy work.

    Thank you very much for help in advance.

    #2
    Hello AlexFdv,

    Your tick data will load the same number of days as the primary data series on your chart. If you primary data series is set to 365 days, then your tick data will load 365 days.

    To prevent this, you will need to reduce the number of days to load in the Data Series parameters on your chart.

    Right-click chart -> select Data Series... -> reduce Days to load.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello AlexFdv,

      Your tick data will load the same number of days as the primary data series on your chart. If you primary data series is set to 365 days, then your tick data will load 365 days.

      To prevent this, you will need to reduce the number of days to load in the Data Series parameters on your chart.

      Right-click chart -> select Data Series... -> reduce Days to load.
      But if i reduce the days to load, will my WMA indicator work?
      E.g. I reduce to load 5 days, and my WMA should be based on period = 89.

      Comment


        #4
        Hello AlexFdv,

        The days to load will be the same. If you need 89 days of daily data for the WMA, then the Days to load will need to be set to 89. This will also load 89 days of tick data.

        It is not supported to do so, but the Pivots indicator is able to get around this using an asyncronous Data.Bars.GetBars() call.

        Basically, this script creates a private Bars dailyBars variable and sets the returned data from Data.Bars.GetBars(). In this way you would be able to cache the year of daily data to that variable without having to add a data series to do it.

        This is done asynchronously because if it is done synchronously it will cache and then not update again.

        Again this is not supported by NinjaTrader and I will not be able to assist with this. But if your interested in this method, take a look at the Pivots indicator on lines 40, 109, 318 - 329, and 378 - 384 (the invalidate causes the plot method to trigger).
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        943 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        9 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by rocketman7, Today, 01:00 AM
        0 responses
        7 views
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        28 views
        0 likes
        Last Post wzgy0920  
        Working...
        X