Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug: Strategy Analyser, Backtest, Min. Bar required

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

    Bug: Strategy Analyser, Backtest, Min. Bar required

    Version 6.5.1000.14

    When Running a Backtest in Strategy Analyzer it appears that the "Min. Bars required" parameter is not passed correctly to indicatiors displayed in a Strategy. Reguardless of its Min Bars value the Indicators remain set to 20.

    Steps to Reproduce.
    1. I added 2 lines in the Initialize() method
    Add(SMA(sMAFast));
    SMA(sMAFast).Plots[
    0].Pen.Color = Color.Green;
    SMA(sMAFast).Plots[
    0].Pen.Width = 2;
    SMA(sMAFast).Plots[
    0].Pen.DashStyle = DashStyle.Dash;

    Add(SMA(sMASlow));
    SMA(sMASlow).Plots[
    0].Pen.Color = Color.Black;
    SMA(sMASlow).Plots[
    0].Pen.Width = 3;

    I set the Periods to 1 & 2 respectively. So they should draw immediately.

    2. All added lines start to be visible on the 21st Bar in the Chart Tab.

    If I change the Strategy's "Min. Bars required" parameter. The starting position of the added lines remains the same.

    I tried setting "Min. Bars required" = 1 & also to 100. The Strategy does correctly start trading on the bar required. But the Visual Indicators all seem to remain at 20.

    Is this a bug or is this by design?

    #2
    Hello,

    If I recall, you can use BarsRquired = 1 in the initialization to get what you want. The setting you are changing changes the strategy executions only. This link should help:


    Post a reply if that does not work and I'll have someone assist you on Monday.
    DenNinjaTrader Customer Service

    Comment


      #3
      min bars required

      Hi, what exactly does this parameter mean? If I'm running a strategy that would enter a trade and exit based all on crossover of an indicator, what relevance does min bars required have to that strategy? Does it mean that if the crossover to exit occurs before say 20 bars are plotted (I assume that would translate to 20 minutes on a 1 minute chart) then the strategy won't execute if the min bars required is set to 20? Or does it mean that the strategy won't even enter on the crossover if the chart doesn't have at least 20 minutes plotted on it, but it will all run fine so long as the chart is loaded with at least 20 minutes (1 min charts)? Or does there have to be 20 more bars that plot once the strategy is turned on?
      Thanks.
      Last edited by werido; 12-17-2009, 01:43 PM.

      Comment


        #4
        It does what its name sounds like. It means your strategy does not start till it has 20 bars minimum. Once it reaches having 20 bars on the chart, then it starts processing its strategy logic.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          before of after you select the strategy?

          But does the strategy start if there are 20 bars plotted on the chart when you apply the strategy to the chart? Or does there have to be 20 more bars drawn after you apply a strategy for the strategy to begin operating? Or does it force a global rule on the strategy that there has to be 20 bars between open and close of a trade?
          Thanks.

          Comment


            #6
            The strategy will start if there are 20 bars on the chart when the strategy is applied.
            AustinNinjaTrader Customer Service

            Comment


              #7
              ok, thanks a million!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              5 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X