Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Backtesting Futures CL from "Ancient" Time..

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

    Backtesting Futures CL from "Ancient" Time..

    Hello,
    I was wondering if it was relevant to backtest Crude Oil Futures CL, which expires every month, on a period quite far, lets say between 2007-2008.
    I am using Merge Back Adjusted settings with a Mean Reversal Strategy. Meaning that the price seeing on my chart for the year 2008 is ABSOLUTELY TOTALLY different from live data at this time.

    So is it relevant to Backtest/Walk Forward on such period?

    Looking for your feedback,

    Kind regards
    Christophe.

    #2
    yes very relevant to consider it...

    Oil high prices compared to now...
    a system that only works well on oil with a 2% daily ATR at a price of $100 will be finding it very tricky right now if it is only reliant on that phase ... so you must know when a system works and when not and what phase the market is in, volume ,price, trend, range

    Probably missout the Global Financial crisis -
    Do a backtest say from: September 2009 to september 2015
    Visual backtest/sense check
    Then an out of sample say 120 days
    does it all still look ok?

    >>then track and make a excel/database of what you tried

    then run it in realtime sim trading for several weeks months

    >> track that stats weeklty in excel, instrument,dataseries, strategy/settings... weekly cash summary/journal


    Here is some info on an approach i use when trading for hedge funds and backtesting etc for due diligence - ie each system has to be inspect and seriously vetted prior to trading for legal reasons/compliancy etc
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    Comment


      #3
      Thanks for the answer.
      My concern is about the accuracy of the prices you get in year 2008.
      Because of the merge policies an offset is applied to the chart to roll all CL contract over the years.
      I'm even not sure that any indicator such as the ATR be relevant: The volatility may be totally different from the live data at the time from the data we get today..

      Do you see my point?

      Comment


        #4
        Hello cbadr,

        With the merge policy set to MergeBackAdjusted the data previous to the current contract is multiplied by an offset. This is to adjust the data so there is no price gap as the contract months switch. In this way we are measuring the movement and distance of prices which are still the same.

        With the merge policy set to MergeNonBackAdjusted, the data is still stitched together but the offset is not applied. All the previous months will show the exact prices they traded at the time, however, large price gaps will appear where one contract month ends and the new contract month begins. This could mess up your calculations.

        In the end, for indicator calculations to make sense it's suggested to use MergeBackAdjusted.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by cbadr View Post
          Thanks for the answer.
          My concern is about the accuracy of the prices you get in year 2008.
          Because of the merge policies an offset is applied to the chart to roll all CL contract over the years.
          I'm even not sure that any indicator such as the ATR be relevant: The volatility may be totally different from the live data at the time from the data we get today..

          Do you see my point?
          http://www.tickdata.com are a reputed company for data you can get a continous contract
          and import to NT7/NT8 -
          Last edited by MicroTrends; 03-05-2017, 09:43 PM.
          MicroTrends
          NinjaTrader Ecosystem Vendor - micro-trends.co.uk

          Comment


            #6
            Originally posted by cbadr View Post
            Hello,
            I was wondering if it was relevant to backtest Crude Oil Futures CL, which expires every month, on a period quite far, lets say between 2007-2008.
            I am using Merge Back Adjusted settings with a Mean Reversal Strategy. Meaning that the price seeing on my chart for the year 2008 is ABSOLUTELY TOTALLY different from live data at this time.

            So is it relevant to Backtest/Walk Forward on such period?

            Looking for your feedback,

            Kind regards
            Christophe.

            Is your strategy intraday only? Then no.

            If you are trading across contract months, then probably... I've never tried.
            Last edited by sledge; 03-05-2017, 10:24 PM.

            Comment


              #7
              Thanks for the reply.
              My strategy is intraday although i have no more than 40 trades per year.
              When i backtest i want to make sure i have enough data to evaluate the strategy.
              Anyway i'll let my strategy running for a while in sim mode and see if it behave properly.

              Thanks
              Chris

              Comment


                #8
                Originally posted by cbadr View Post
                Thanks for the reply.
                My strategy is intraday although i have no more than 40 trades per year.
                When i backtest i want to make sure i have enough data to evaluate the strategy.
                Anyway i'll let my strategy running for a while in sim mode and see if it behave properly.

                Thanks
                Chris
                100% agreed... with you - the real-time sim test is a great thing - but wouldn't it be fantastic to know what it did in the past and see a different view. would it drawdown by 50K in 1 year? etc. can you cope with that? perhaps you need 3X the drawdown. Can you cope with the string of consecutive loses psychologically, what’s its win ratio / RR - Expectancy... when does it go into drawdown what phase...?

                Intraday or EOD You 1000,000% definitely need test as much as data as you can to avoid curve fitting. Can you imagine a head trader or fund manager letting you lose on their capital without due diligence. Never. it has to be proven and assessed in many levels -so therefore why let it lose on your cash without the same level of care and attention... an approach that has saved my skin and provided success as a professional algorithmic trader working for hedge funds, prop shops and self-directed.

                1. Historical Test on a large dataset and be careful not to trade/ rely on some sell or recovery period -avoid skew, shock and bias
                2.Sense check it visually.
                3. if pass: then use out of sample
                4. if pass: then use a real-time sim test
                5. if pass after a few months perhaps consider it viable for live

                Its ultra important to beware of the period you are testing - also... To avoid curve fitting or results that are not repeatable in the current market.. . if the system was success when it had a high price or a larger range or was not a smaller range consolidation channels for long periods for example is it wise to use the system now etc. . I.E - when does your strategy win or loss - is there a relationship between high price, daily ATR & volume and market structure how does it fair now etc.

                know when your system wins and losses and what type of market - then identify it and compare with todays - is it sensible to use it... also the out of sample and recent out of sample test and real-time sim test will insulate you.

                Thus a back testing period of: Sept 2009 to Sept 2015 provide perhaps as long enough testing to have some idea if its viable over a few different market phases. i.e. was 2008 unduly favourable and on its own long to provide a valid test? was it near some kind of GFC crash or recovery did that affect it

                It's easy to use a continuous contract or a merge policy in NT so you can back test it etc. without having to run 100s of separate back tests etc. as you are intraday and low frequency trading your margin of error in the hypothetical universe is closer to reality if history repeated.

                Probably 99% of all traders will not do this, not get data, not go through a systematic process and fail. The win rate for traders using discretionary is far higher as this myth exists mechanical trading is easier.

                With so many permutations it’s easier to store the trials and results of back test and the real-time and build a database - again something most traders won’t do so guess what they go in circles or use recency bias and emotion instead of statistical evidence - this might be useful:





                it has some excel stuff for monitoring and stats etc
                Last edited by MicroTrends; 03-06-2017, 03:52 AM.
                MicroTrends
                NinjaTrader Ecosystem Vendor - micro-trends.co.uk

                Comment


                  #9
                  Originally posted by cbadr View Post
                  Thanks for the reply.
                  My strategy is intraday although i have no more than 40 trades per year.
                  When i backtest i want to make sure i have enough data to evaluate the strategy.
                  Anyway i'll let my strategy running for a while in sim mode and see if it behave properly.

                  Thanks
                  Chris

                  Actually maybe some good info here also:
                  Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.




                  Hi, Optimization refers to the combinatorial search over a range of system input values on price data defined over a fixed number of bars for the cases that produce the best system net profits or some other selected performance variable. It is unavoidable because markets lack stationarity in any ...
                  MicroTrends
                  NinjaTrader Ecosystem Vendor - micro-trends.co.uk

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Radano, 06-10-2021, 01:40 AM
                  20 responses
                  615 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by Mizzouman1, Today, 07:35 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post Mizzouman1  
                  Started by i019945nj, 12-14-2023, 06:41 AM
                  6 responses
                  66 views
                  0 likes
                  Last Post i019945nj  
                  Started by aa731, Today, 02:54 AM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by BarzTrading, Today, 07:25 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post BarzTrading  
                  Working...
                  X