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,496 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?

  #11 (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,162 since Jan 2013
Thanks Given: 57,343
Thanks Received: 26,267


kevinkdog View Post
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.

Beat me to it, Kevin! I was typing in my long-winded way while you were getting to the point, in a much simpler way too.

But this is the thing that's important.

Bob.

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

Can you help answer these questions
from other members on NexusFi?
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Are there any eval firms that allow you to sink to your …
Traders Hideout
Build trailing stop for micro index(s)
Psychology and Money Management
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


bobwest View Post
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.


I get the feeling we were both typing the same answer at the same time. Brothers from a different mother..

Follow me on Twitter Reply With Quote
Thanked by:
  #13 (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



bobwest View Post
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.

Yes, Bob, it does, and I have considered that. For two years I have been following a price action trader live in his trading room. There are ways I have learned to differentiate the likelihood of a sideways vs. a trending market. Sideways markets are likely to have overlapping bars, lots of tails, poor follow through, a lack of consecutive trend bars, and often occur when prices oscillate around the twenty-bar moving average. Even more pertinent is when two or more moving averages are close together. Once these conditions occur, the odds of successful breakouts diminish to about 20%. Reversals are 80% more likely, so scaling in once if the trade moves against me increases probability. Twice, maybe, but I am not comfortable allowing any more than that.

The problem is that these conditions are mostly based on price action, so placing them into the strategy for back testing is beyond my ability. Friday, for instance, I knew we we in a sideways market by midday, so I completed the strategy during the day and tested it, with good results.

If the day starts off with consecutive trend bars with minimal overlap, and breakouts are successful with follow through, and the 20-bar EMA provides support (as well as the 20-bar EMA on the 1 - min chart, I would not even attempt to use this strategy until breakouts begin to fail and there is evidence that limit order counter-trend traders are starting to make money.

Therefore, as you say, back testing is problematic because my determining market direction is based on price action with moving average verification. ADX also adds some value. I can't code for price action beyond bars closing above/below their median prices.

I appreciate your insight and welcome your input.

Started this thread Reply With Quote
Thanked by:
  #14 (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


kevinkdog View Post
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.

Thanks for the reply. I answered it above. If you have any suggestions for making the computer recognize price action, let me know. I'm not being facetious. I have struggled this. I'm trying to combine price action with automated trading. I can often recognize market type, but like many, I let emotion cloud the execution. My goal is to let the computer trade the way I would if I could act like a computer.

Started this thread Reply With Quote
  #15 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,647 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338


Bionan View Post
Thanks for the reply. I answered it above. If you have any suggestions for making the computer recognize price action, let me know. I'm not being facetious. I have struggled this. I'm trying to combine price action with automated trading. I can often recognize market type, but like many, I let emotion cloud the execution. My goal is to let the computer trade the way I would if I could act like a computer.

You mention:
Sideways markets are likely to have overlapping bars,
lots of tails,
poor follow through
lack of consecutive trend bars
prices oscillate around the twenty-bar moving average.
two or more moving averages are close together.

All those things can be defined and coded (although defining "poor follow through" will be tough).

Let's just take one of those:

"lots of tails"

1. Define what exactly is and is not a tail bar

2. Define what "lots" is


Just break all those in pieces, and code each piece.

In my opinion, coding those will not be the hard part. What will be hard is, after you program, you realize that many of those sideways "tells" are not as good as you originally thought... if that is the case, that is a major blow to your strategy.

Sideways action is easy to pinpoint in hindsight, but much tougher to see in real time.

Follow me on Twitter Reply With Quote
Thanked by:
  #16 (permalink)
 
mattz's Avatar
 mattz   is a Vendor
 
Posts: 2,493 since Sep 2010
Thanks Given: 2,440
Thanks Received: 3,789

Instead of focusing on infrequent trading (larger time frame) and growing the size of contracts if the method works, most want to do the opposite, i.e. choose frequent trades with small profits not aware of all the pitfalls that @kevinkdog and @bobwest mentioned.

Matt Z
Optimus Futures

There is a substantial risk of loss in futures trading. Past performance is not indicative of future results.

Trading futures and options involves substantial risk of loss and is not suitable for all investors. Past performance is not necessarily indicative of future results. You may lose more than your initial investment. All posts are opinions and do not claim to be facts. Please conduct your own due diligence. Use only Risk capital when trading Futures.
1 800 771 6748 local 561 367 8686 email [email protected]
Reply With Quote
Thanked by:
  #17 (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


kevinkdog View Post
You mention:
Sideways markets are likely to have overlapping bars,
lots of tails,
poor follow through
lack of consecutive trend bars
prices oscillate around the twenty-bar moving average.
two or more moving averages are close together.

All those things can be defined and coded (although defining "poor follow through" will be tough).

Let's just take one of those:

"lots of tails"

1. Define what exactly is and is not a tail bar

2. Define what "lots" is


Just break all those in pieces, and code each piece.

In my opinion, coding those will not be the hard part. What will be hard is, after you program, you realize that many of those sideways "tells" are not as good as you originally thought... if that is the case, that is a major blow to your strategy.

Sideways action is easy to pinpoint in hindsight, but much tougher to see in real time.

These are good questions. By "lots of tails", what I mean is that, on time frames smaller than the trading time frame, bars are not breaking out, but are reversing at or just above prior highs/lows. In other words, there are signs that computers are betting on reversals. So there would be lots of doji's, small bodies, hanging men and hammers, engulfing patterns, etc. Also, tall candles closing on their highs and lows tend to be faded rather than following thriugh. And the best indication is that support and resistance levels are holding and reversing.
I suppose the only way I can know for sure that I can rocognize it real time is to paper trade the strategy live.
My intent is to combine this strategy with trend following strategies on the higher time frame (5-minute) on a different account.

Started this thread Reply With Quote
  #18 (permalink)
AffinityDeal
New York City N.Y. USA
 
Posts: 2 since Jul 2015
Thanks Given: 1
Thanks Received: 1

I save my data to relational database daily and purge data older then six months.

Reply With Quote
Thanked by:
  #19 (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


mattz View Post
Instead of focusing on infrequent trading (larger time frame) and growing the size of contracts if the method works, most want to do the opposite, i.e. choose frequent trades with small profits not aware of all the pitfalls that @kevinkdog and @bobwest mentioned.

Matt Z
Optimus Futures

There is a substantial risk of loss in futures trading. Past performance is not indicative of future results.

Thanks for the reply. I'm not exactly sure what you are saying. Markets spend more time in trading ranges than trending. On most days there is some point in time where the market is range bound, usually in the middle third of the day. This strategy looks for a trading range to short the top of a prior high and buy near the prior low and scalp for roughly 1 x ATR, with a scale in 2 X ATR beyond the entry. The range needs to remains within 32 ticks of the entry to avoid a stop out. This is a pretty common pattern.

Started this thread Reply With Quote
Thanked by:
  #20 (permalink)
 
mattz's Avatar
 mattz   is a Vendor
 
Posts: 2,493 since Sep 2010
Thanks Given: 2,440
Thanks Received: 3,789



Bionan View Post
Thanks for the reply. I'm not exactly sure what you are saying. Markets spend more time in trading ranges than trending. On most days there is some point in time where the market is range bound, usually in the middle third of the day. This strategy looks for a trading range to short the top of a prior high and buy near the prior low and scalp for roughly 1 x ATR, with a scale in 2 X ATR beyond the entry. The range needs to remains within 32 ticks of the entry to avoid a stop out. This is a pretty common pattern.

Yes, I agree that markets are range-bound, but one-minute signal based systems require hosting, direct API and exchange memberships to lower costs. They rarely work for regular retail.

Matt Z
Optimus Futures

There is a substantial risk of loss in futures trading. Past performance is not indicative of future results.

Trading futures and options involves substantial risk of loss and is not suitable for all investors. Past performance is not necessarily indicative of future results. You may lose more than your initial investment. All posts are opinions and do not claim to be facts. Please conduct your own due diligence. Use only Risk capital when trading Futures.
1 800 771 6748 local 561 367 8686 email [email protected]
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