Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy test in real time and backtest – inner working question

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

    #16
    Brett,

    We are getting close

    From your reply, "......SMA(BarsArray[0]) is the value of the SMA from the primary series. I believe this is what you want....."

    No, it is not exactly what I want. I want SMA not only on primary series, but also on secondary series before the current primary bar series close.

    Comment


      #17
      Unfortunately not possible in backtesting. You simply do not have the granularity needed to do that.

      -Brett

      Comment


        #18
        Sorry to hear that, but somehow I am not convinced that it can't be done in backtest. It's really about how to generate a new data series which combines primary and secondary data series in a way that only current bar (n=0) taken from secondary series, the rest of bars are taken from primary data series. Something like:

        primary bar series: P[0],P[1],P[2],.....
        secondary bar series: S[0],S[1],S[2],......
        new bar series: S[0],P[1],P[2],.....

        Maybe someone can come up with a solution.

        Comment


          #19
          Hi millridge,

          DataSeries are synced to bar objects. There will always be the same number of elements in your DataSeries as bars. If your idea requires that DataSeries are sometimes synced to primary bars and other times synced to secondary, this would not work. You can sync DataSeries to a secondary series, but it's not possible for one object to be synced to multiple time frames.
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by nleitman, Yesterday, 11:46 AM
          14 responses
          33 views
          0 likes
          Last Post nleitman  
          Started by MSerag, Yesterday, 11:52 PM
          3 responses
          23 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by dcriador, Yesterday, 01:43 AM
          6 responses
          27 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by James650, Today, 08:25 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by Rogers101, 05-05-2024, 11:30 AM
          14 responses
          40 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X