Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade problem

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

    #16
    frostengine, I don't see an issue here - when you're using 30 days back loaded and then add a MinBarsSetting of 29, you effectively have only 1 bar left on which the strategy would run then.

    If you up it to 50 and still use the 29 min bars, you end up with 21 left which is enough for example for the EMA 20 to give a reasonable value then.
    BertrandNinjaTrader Customer Service

    Comment


      #17
      Perhaps I am thinking about these values incorrectly. What I assumed is having 30 days to load would load the past 30 days worth of values. Then with min bar 29 set it would say that the strategy will not fire until it has at least 29 bars. The strategy trades on 5 minute bars, but also does calculations on the past 20 days closing prices.

      So the way I look at this is.. Loads all 30 days worth.. then when it gets to having 29 bars it can start firing.. but would have access to all 29 bars that were loaded previously to this.. So instead of having only 1 bar to calculate the EMA on as you said, i assumed it would have 29 BARS to calculate. Why would it throw out the information for the 29 previously? I would think the point of saying have 29 minimum bars is that you dont want the strategy to fire until its loaded enough data.. after it has 29 bars it has enough so its ok to run the strategy.. but what your saying implies it just loses the 29 bars before this.. If thats the case why set a minimum bar requirement? Seems smarter to leave it at 0 or 1?

      That to me doesn't quite explain why the closing price it shows was from 5-25... Shouldn't the closing price be the closing price of the most recent day? I guess there is just some major confusion on my part about what the minimum bars is suppose to represent?

      Comment


        #18
        frostengine, the MinBarsRequired has to be satisfied for all series to get an OnBarUpdate() call from your strategy - this has no direct relation to the historical data to load setting, a MinBarsBack of 20 means there's no OnBarUpdate() for the first 20 bars on your chart. You can leave it at 0, however many indicators / strategies need a certain amount to normalize out any erratic start up behavior due to calcs catching up - same would be seen for the unstable indicator period we have on the chart properties for NT 6.5 - this would be 20 bars as well and those would not show per default.
        BertrandNinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Bertrand View Post
          frostengine, the MinBarsRequired has to be satisfied for all series to get an OnBarUpdate() call from your strategy - this has no direct relation to the historical data to load setting, a MinBarsBack of 20 means there's no OnBarUpdate() for the first 20 bars on your chart. You can leave it at 0, however many indicators / strategies need a certain amount to normalize out any erratic start up behavior due to calcs catching up - same would be seen for the unstable indicator period we have on the chart properties for NT 6.5 - this would be 20 bars as well and those would not show per default.
          This is how I understood it and why I am confused. Instead of using MinBarsBack of 20 I used 29. Which means I was telling the strategy do not fire any OnBarUpdates until that is satisfied. I then told it to load 30 days worth of data. This should have been sufficient for all data series (5 min bars and daily bars) to have 29 bars. Which it must have because my OnBarUpdate fired (for the 5 min bars). When my OnBarUpdate fired and I tried to access the data in the daily bars it was showing data from over 1 month ago. And did not seem to have sufficient bars to calculate the indicator. What happened to the 29 bars worth of data that was required?

          The only thing I can imagine happened is when you tell it load 30 days of data, that is 30 calendar not trading. And therefore it did not get enough bars to satisfy the 29 bars on the daily. That could explain this i suppose?

          Thanks for your help

          Comment


            #20
            frostengine, I'll be off here soon but will reproduce this tomorrow on my end - however it would be just calendar days, so your reasoning seems accurate to me.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            150 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            6 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            6 views
            0 likes
            Last Post tkaboris  
            Working...
            X