Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars to look Back for Calculation

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

    Bars to look Back for Calculation

    Hello, how exactly it works ?
    Maximum Bars Look Back Sets the maximum number of historical bars to use for strategy calculations. The TwoHundredFiftySix setting is the most memory friendly
    Bars Required to Trade Sets the minimum number of historical bars required to start taking live trades

    Strategy from a Chart /
    The trading hours on chart is 24x7, My strategy runs a 50 ma from 0900. How the calculation is done ? Does it consider the 50 50 candles before 0900 (from chart or database), or waits for to 50 candles to be completed after after 0900 ?

    Strategy from the Strategies Tab
    Same question. Does the strategy look back on the historical database before 0900 or waits for 50 candles after 0900 ?

    What the setting should be to, for a 50 ma strategy, so as to start calculation 50 candles before start time ?


    #2
    Hello as002,

    Thanks for your post.

    The Bars Required To Trade property will wait until there are a certain number of historical bars loaded on the chart before the strategy will place a trade.

    Say you set the Bars Required To Trade property to 50, this means the strategy will not place trades until there are 50 bars loaded on the chart from the leftmost (first) bar to the current bar on the chart.

    The Maximum Bars Look Back property is related to the memory performance of Series<T> objects like a custom Series<double> object in a NinjaScript. This property could typically be set to MaximumBarsLookBack.TwoHundredFiftySix unless for some reason you need to look back further than 256 bars for calculations in your script.

    When this property is set to TwoHundredFiftySix only the last 256 values of the series object will be stored in memory and be accessible for reference. This results in significant memory savings when using multiple series objects in your NinjaScript. In the rare case should you need older values you can use MaximumBarsLookBack.Infinite to allow full access of the series.

    Please see the help guide documentation below for more information.

    Bars Required To Trade: https://ninjatrader.com/support/help...equiredtotrade
    Maximum Bars Look Back: https://ninjatrader.com/support/help...bars+look+back
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    71 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    143 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X