Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

back testing and multiple instruments

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

    back testing and multiple instruments

    Hi!

    I'd like to understand the back testing process internals a little better. Suppose I have some strategy that is basically a single instrument strategy. Now, suppose that I back test it on an instrument list (either back testing or optimizing). So it will run on all the instruments on the list.

    Clearly, the strategy will only see one instrument at a time (per instance of the class), and if I am running an optimization then each instance would run independently from the others.

    However, is the order of execution well defined?
    1. In regular back testing - does the "clock tick together" for all instances? That is to say, do you simulate reality in the sense that you run all instances (for all symbols in the list) and then run the first bar for each instrument, then "advance the clock" and run the next bar for all instruments, etc?
    2. In optimization runs, what is the order of execution. E.g. run the full simulation on one set of parameter values, then run the full simulation on the next set etc? Or is there another defined order of execution?

    Thanks

    #2
    arnonmoscona,

    1. There would be no syncronization taking place, for a bar by bar replay of running multiple strategies you could be looking into our Market Replay features - http://www.ninjatrader.com/support/h...ket_replay.htm

    2. Backtesting and Optimization would take advantage of multiple cores available - correct the instances being tested would run through the complete parameter space sequentially if the 'default' / 'exhaustive' optimization route is being chosen.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks. So from what you're saying then, when using back testing and optimization I would not be able to use any logic that uses any common state of the strategies. For instance, if the strategy does some automatic capital management by accessing the account info (say, using code based on Custom/MarketAnalyzer/@ProfitLoss.cs) then the feature wound need to be turned off as it would produce incorrect values in backtesting and optimization...

      Correct?

      Comment


        #4
        Hi arnonmoscona,

        That's correct. You can consider each instance (or each instrument in your case) as completely independent. There is no built in strategy communication among instances, but you could consider sharing information through a file. It is beyond our scope of support, but you may also want to look into global static concept in C#.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Actually, from what you described on the order of execution - sharing through a file, or database, or even static members would not work. All shared state depends by its nature on a simultaneous clock. Any such shared state would fail to produce correct values in a backtesting or optimization scenario (worse so in the optimization case). Any features that depend on any kind of shared state must therefore be turned off in simulation...

          Comment


            #6
            In general these are the approaches used for sharing information from multiple instances of a strategy. Of course, you will have to evaluate whether they are appropriate for your strategy design.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              We are Providing Testing Instruments

              Presto Testing Instruments - Manufacturer & exporter of Testing Machines, Paper Testing Instruments, Material Testing Equipments & Paper Packaging.

              Bottle Testing
              Vibration Table
              Melt Flow Index
              Go No Go Gauge
              Secure Seal Tester
              TORQUE TESTER
              Top Load Tester
              Hot Wire Bottle Cutter
              Polariscope
              Testing Instruments
              Melt Flow Index

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by techgetgame, Yesterday, 11:42 PM
              0 responses
              8 views
              0 likes
              Last Post techgetgame  
              Started by sephichapdson, Yesterday, 11:36 PM
              0 responses
              2 views
              0 likes
              Last Post sephichapdson  
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,613 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Yesterday, 05:56 PM
              0 responses
              10 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              20 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Working...
              X