NexusFi: Find Your Edge


Home Menu

 





How many days to back test a 1 minute algorithm?


Discussion in Emini and Emicro Index

Updated
      Top Posters
    1. looks_one Bionan with 13 posts (7 thanks)
    2. looks_two kevinkdog with 4 posts (11 thanks)
    3. looks_3 AllSeeker with 3 posts (4 thanks)
    4. looks_4 DoubleUCapital with 2 posts (1 thanks)
      Best Posters
    1. looks_one kevinkdog with 2.8 thanks per post
    2. looks_two bobwest with 2 thanks per post
    3. looks_3 AllSeeker with 1.3 thanks per post
    4. looks_4 Bionan with 0.5 thanks per post
    1. trending_up 7,729 views
    2. thumb_up 33 thanks given
    3. group 12 followers
    1. forum 31 posts
    2. attach_file 0 attachments




 
Search this Thread

How many days to back test a 1 minute algorithm?

  #1 (permalink)
 Bionan 
Palm Harbor, Florida/USA
 
Experience: Intermediate
Platform: NinjaTrader, SharkIndicat
Broker: Interactive Brokers, NinjaTrader Brokerage, TD Ameritrade
Trading: ES
Posts: 76 since Dec 2019
Thanks Given: 78
Thanks Received: 98

For those of you who use a 1 minute ES day trading algorithm for scalping (8 ticks per trade in my case), how many days of data would you use to back test it? For such a short time frame, I'm not sure it is necessary, or even pertinent, to back test beyond a few weeks. Your thoughts?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
 
  #3 (permalink)
 
AllSeeker's Avatar
 AllSeeker 
Mumbai, India
Legendary Pratik_4Clover
 
Experience: Beginner
Platform: TradingView & ZerodhaKite
Trading: NIFTY, BANKNIFTY
Frequency: Daily
Duration: Minutes
Posts: 1,424 since Jan 2019
Thanks Given: 5,249
Thanks Received: 5,012


I like minimum 1 year, I've little itch to check larger sample size. Market change their behavior more than we think and its always better to check your strategy no matter the time frame on largest possible data range.

It really shouldn't be that much of trouble to stretch for at least that much.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 Bionan 
Palm Harbor, Florida/USA
 
Experience: Intermediate
Platform: NinjaTrader, SharkIndicat
Broker: Interactive Brokers, NinjaTrader Brokerage, TD Ameritrade
Trading: ES
Posts: 76 since Dec 2019
Thanks Given: 78
Thanks Received: 98


LastDino View Post
I like minimum 1 year, I've little itch to check larger sample size. Market change their behavior more than we think and its always better to check your strategy no matter the time frame on largest possible data range.

It really shouldn't be that much of trouble to stretch for at least that much.

Thanks for your reply. I have wondered about about data integrity when using futures that many days ago, especially with 1-minute charts, since trading on the ES gets pretty thin when you go past the last roll over date. I use NinjaTrader, and I have it set to merge back data, but I am not yet confident that it provides accurate data much past the last roll dates for a 1-minute chart.

Plus I am testing a strategy for choppy markets, so market conditions are important. To truly back test this strategy, I need to filter out trend days.

Started this thread Reply With Quote
  #5 (permalink)
 
AllSeeker's Avatar
 AllSeeker 
Mumbai, India
Legendary Pratik_4Clover
 
Experience: Beginner
Platform: TradingView & ZerodhaKite
Trading: NIFTY, BANKNIFTY
Frequency: Daily
Duration: Minutes
Posts: 1,424 since Jan 2019
Thanks Given: 5,249
Thanks Received: 5,012


Bionan View Post
Thanks for your reply. I have wondered about about data integrity when using futures that many days ago, especially with 1-minute charts, since trading on the ES gets pretty thin when you go past the last roll over date. I use NinjaTrader, and I have it set to merge back data, but I am not yet confident that it provides accurate data much past the last roll dates for a 1-minute chart.

Plus I am testing a strategy for choppy markets, so market conditions are important. To truly back test this strategy, I need to filter out trend days.

I don't use Ninja so I can't really comment, but here is little suggestion for future use, it is better to buy past tick data for what you trade or plan to trade so you can do back testing at your end. Lot of people do that, especially if they are coders. Plus, you get advantage of using what you know how to code or are comfortable with.

Generally, there aren't any great issues in terms of data integrity on popular platforms, because there are quite a few professional people doing back tests on very large sets of data on as small as tick level, let alone one minute. So you should be fine. If you still have doubts about integrity, you can adjust for some errors in you final results. I'm sure you wont need it though.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
bobb's Avatar
 bobb 
near Vienna Austria
 
Experience: Intermediate
Platform: TradeStation, MultiCharts
Trading: Stocks, Forex
Posts: 6 since Apr 2012
Thanks Given: 1
Thanks Received: 1

Try to choose so many days (50 or more) that you have at minimum 100 Trades for analyze.

Reply With Quote
  #7 (permalink)
 Bionan 
Palm Harbor, Florida/USA
 
Experience: Intermediate
Platform: NinjaTrader, SharkIndicat
Broker: Interactive Brokers, NinjaTrader Brokerage, TD Ameritrade
Trading: ES
Posts: 76 since Dec 2019
Thanks Given: 78
Thanks Received: 98


bobb View Post
Try to choose so many days (50 or more) that you have at minimum 100 Trades for analyze.

Thanks for the input, Bobb. I have read up to 1,000 trades. But since this is a 1-minute intra-day strategy intended for sideways markets, I am thinking that to apply it longer-term in a trending market would under-estimate the effectiveness of the strategy.

Started this thread Reply With Quote
  #8 (permalink)
 Bionan 
Palm Harbor, Florida/USA
 
Experience: Intermediate
Platform: NinjaTrader, SharkIndicat
Broker: Interactive Brokers, NinjaTrader Brokerage, TD Ameritrade
Trading: ES
Posts: 76 since Dec 2019
Thanks Given: 78
Thanks Received: 98

Thanks for the replies. Let me give a little more information regarding the background of my question.

This is an auto strategy which would have produced 202 trades in November, and produced $4987.50 in profits on 1 contract with a 1-contract scale in at -16 ticks. The max drawdown was -$1,312.50. December to date is $3850 on 130 trades with a max drawdown of -$1600. To me, these are good results.

But it is a 1-minute 8-tick scalping strategy for sideways markets, so it should be applied to sideways markets. November and December were sufficiently sideways to product these results, but a 6-month backtest only produces $8862.50 with a Max drawdown of $8187.50. Obviously not desirable, but there were many big, trending days during this time period for which the strategy was not designed.

So the premise of my question is this: if I am back testing a strategy which should only be profitable in sideways markets, shouldn't I back test it in sideways markets?

Started this thread Reply With Quote
  #9 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


Bionan View Post
Thanks for the replies. Let me give a little more information regarding the background of my question.

This is an auto strategy which would have produced 202 trades in November, and produced $4987.50 in profits on 1 contract with a 1-contract scale in at -16 ticks. The max drawdown was -$1,312.50. December to date is $3850 on 130 trades with a max drawdown of -$1600. To me, these are good results.

But it is a 1-minute 8-tick scalping strategy for sideways markets, so it should be applied to sideways markets. November and December were sufficiently sideways to product these results, but a 6-month backtest only produces $8862.50 with a Max drawdown of $8187.50. Obviously not desirable, but there were many big, trending days during this time period for which the strategy was not designed.

So the premise of my question is this: if I am back testing a strategy which should only be profitable in sideways markets, shouldn't I back test it in sideways markets?

How does your strategy know WHEN it is a sideways market? Saying you should not run it last Sept and Oct because those months were trending is one thing, but knowing that in real time is another.

If your strategy can't tell when it is sideways, but can only exploit sideways, your 2 month backtest will not really help. It just confirms what you know - in sideways markets, strategy works great.

Hope this makes sense. Just my 1 cent.

Follow me on Twitter Reply With Quote
  #10 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,513
Thanks Received: 26,292



Bionan View Post
Thanks for the replies. Let me give a little more information regarding the background of my question.

This is an auto strategy which would have produced 202 trades in November, and produced $4987.50 in profits on 1 contract with a 1-contract scale in at -16 ticks. The max drawdown was -$1,312.50. December to date is $3850 on 130 trades with a max drawdown of -$1600. To me, these are good results.

But it is a 1-minute 8-tick scalping strategy for sideways markets, so it should be applied to sideways markets. November and December were sufficiently sideways to product these results, but a 6-month backtest only produces $8862.50 with a Max drawdown of $8187.50. Obviously not desirable, but there were many big, trending days during this time period for which the strategy was not designed.

So the premise of my question is this: if I am back testing a strategy which should only be profitable in sideways markets, shouldn't I back test it in sideways markets?

My only question is simply, can you tell in advance that you are going to have a sideways market? Not looking back in time and saying, "Oh, this was a trending market, I can't use the strategy for that," but looking forward in real time, and say, "Oh, this will be a trending market, I can't use the strategy now."

Or to put it another way, if you decide you will only test in periods when, as you look back at them, you can see that the market wasn't trending, you are seriously curve-fitting your test -- you are selecting the data you will test it for, because you know what the outcome was.

That will make your test essentially not worth anything. And that makes your question kind of irrelevant also, since you're only going to test during times when you know it will do well. Why test at all then?

By the way, I understand the dilemma because I have it too. I know that certain things work well during trends but not during sideways non-trends, and vice versa. There's a sort of Catch-22 there, because you can't use the method that works well in non-trending markets profitably unless you already know they will be non-trending.

But you do need a way to tell the difference, ahead of time, and then you need to incorporate whatever criteria you have developed to answer the question into the test itself, so you can test it realistically under the same type of conditions you will face with it when going live.

I hope this makes sense and is useful to you. Good luck with the strategy and your testing. And be sure you can answer this question.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote




Last Updated on December 28, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts