• 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.


No announcement yet.

Partner 728x90


MaximumBarsLookBack options

  • Filter
  • Time
  • Show
Clear All
new posts

    MaximumBarsLookBack options

    I would like to understand,

    what is the logic, that only 2 possible values for MaximumBarsLookBack exist:
    • Infinite
    • TwoHundredFiftySix

    Why there is no possibility to set some custom value? or at least some more options to be meet different requirements on some scale? Why is this so black/white? Is it complicated to do more options for different needs?

    Please help for my case:
    256 values back is really too low number, but Infinite values is complete memory killer (required 1500MB of memory in small 4-years backtest).
    If I had access to last 3000 bars, it would be sufficient for all cases.
    How current framework supports this situation?

    Last edited by misova; 03-08-2015, 12:24 PM.

    Hello misova,

    Thank you for your post.

    The bars are still loaded based on the BarsToLoad or DaysToLoad, but the calculations on the current bar can either go back 256 or Infinite. The indicators or strategies will still calculate on the full range of bars loaded but the current bar calculates as far as the MaximumBarsLookBack.

    If the current bar needs to access 3000 bars back then Infinite would be used as you know, but you are correct that this is far more taxing on the resources allocated to the platform. Does your current bar need to access back over 3000 bars? As in using a 3000 period for a moving average (example)?
    Patrick H.NinjaTrader Customer Service


      There is a need to go programmatically around 3000 bars back,
      because lour ogic searches the history for some situation/pattern until if finds it.
      The searched values are often not plotted (I understand, there is always Infinite access on Plots),
      but exposed programmatically via custom property with DataSeries.
      And here is the problem - 256 limit is unacceptable low value, the Infinite too big - consumes extreme resources.

      Do you think, that customizable value for MaximumBarsLookBack would be good enhancement for NT8 or is there any reason, why this is limited to only these 2 values?

      It looks too me like black/white solution various needs...
      Why not let the developer choose the own value for MaximumBarsLookBack ?
      i.e. developer sets own value how many elements should be accessible and maintained in memory on each dataseries?

      From architectural point of view,
      there is nothing like default 256 bars back value.
      That's is just an estimate, that stops working easily even for simple custom indicators.
      To provide the only alternative with Infinite - is another extreme, killing the whole performance.

      Could it be done in NT8?
      It sounds logical - because API should not estimate how many elements the developer will need to access in DataSeries. The API should meet requirements = listen to the developer, who sets the right value, suitable for each case.

      Such API would be well designed, professional and suitable for different needs.


        Hello misova,

        Thank you for your response.

        TwoHundredAndFiftySize was found to be the most CPU friendly during the development of NinjaTrader.

        There is no word on if this would be implemented in a future release of NinjaTrader. I will forward your suggestion to our development team.

        Please let me know if I may be of further assistance.
        Patrick H.NinjaTrader Customer Service


        Latest Posts


        Topics Statistics Last Post
        Started by concept, Yesterday, 04:22 PM
        1 response
        Last Post NinjaTrader_ChristopherS  
        Started by Erwin Beckers, 08-06-2019, 11:54 AM
        2 responses
        Last Post johnvnwp  
        Started by Branpo, 01-28-2020, 06:10 AM
        3 responses
        Last Post Harvard
        by Harvard
        Started by J_o_s, 04-05-2020, 12:36 AM
        2 responses
        Last Post J_o_s
        by J_o_s
        Started by GTBrooks, Yesterday, 05:53 PM
        1 response
        Last Post MojoJojo