• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Zenersev, 10-19-2019, 02:11 PM
        7 responses
        46 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by Lancer, Today, 10:39 AM
        4 responses
        24 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Started by koganam, Today, 11:50 AM
        2 responses
        11 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by koganam, Today, 10:33 AM
        4 responses
        14 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by FREEN, Today, 10:17 AM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X