How long should you backtest a day trading strategy?

Discussion in 'Strategy Building' started by xm020-2959, Aug 30, 2020.

Thread Status:
Not open for further replies.
  1. gaussian

    gaussian

    If you assume a binomial distribution perhaps. But that's not how trading works.

    You'll find in a monte carlo simulation your gains can be substantially less. This code assumes a uniform distribution, which is also not correct, but far more accurate than your binomial assumption.

    Your contrived example also has a flaw in assuming that account size doesn't matter. In fact, it matters a lot. Moreover risking $30 to make $90 is entirely unrealistic. I've never seen such a lopsided profit/loss and I've watched every single tastytrade video where they pretend reality is like that.

    Code:
    import random
    def flip():
        flips = 100
        sum = 0
        current_worst = 0
        worst = 0
    
        for _ in range(flips):
             flip = random.randint(0, 1)
             if (flip == 0):
                  sum = sum + 90
                  if current_worst > worst:
                    worst = current_worst
                  current_worst = 0
    
             else:
                  sum = sum - 30
                  current_worst = current_worst + 1
    
    
        return (worst, sum)
    
    if __name__ == '__main__':
      realizations = []
      drawdowns = []
    
      i = 10000
      while i > 0:
        results = flip()
        realizations.append(results[1])
        drawdowns.append(results[0])
        i = i - 1
    
      print(min(realizations))
      print(max(drawdowns))
    
    In my runs I saw a maximum drawdown period of 17. That means in at least one realization there were 17 straight periods of drawdown. It absolutely matters what your account size is and this scales with leverage. Assuming a 25x leverage a 17 period drawdown will ruin you. Feel free to play with it. I set it to 100 trades which was quite generous for this assumption and ran 10,000 simulations.
     
    #41     Aug 30, 2020
    Overnight likes this.
  2. Shouldn't you be asking how long should I forward test a strategy?

     
    #42     Aug 30, 2020
  3. You are completely missing the point and overthinking the whole thing. Its not code, its math! It has nothing to do with the automated system. If you are making $90 or per trade 50% of the time, and losing $30 the other 50% of the time. It doesn't matter whether you are making 10 trades a day, 100, or even 1000. And the example I used of $90/30 was an example. Realistically I would have a template that would look for a very specific setup where I can make 9 pips/ risk 3 pips. The account size is only relevent when defining an order size in order to calculate profits in USD based on Pips.
     
    #43     Aug 30, 2020
  4. Tradex

    Tradex

    Again, trading systems that earn 3 times the risk 50% of the time do NOT exit, period.

    Unless you are using inside information and you always know stuff that the general public does not know yet.
     
    Last edited: Aug 30, 2020
    #44     Aug 30, 2020
    Option_Attack likes this.
  5. fan27

    fan27

    You are missing the point. You couldn't trade yourself out of a brown paper bag let alone make 1% per day. Go find another hobby.
     
    #45     Aug 30, 2020
    Bugsy likes this.
  6. What are you on about?
    Why would I need to do that? I have proven several strategies are highly capable of making this meager return. I am actually trying to find how to make 5% a day. But that's right, if I could make $500 a day instead of $100 that would overpower the forces of the world and cause the fucking Illuminati to put a hit out on me. Give me a fucking break. Kys and get off my thread asshole.
     
    #46     Aug 30, 2020
  7. Overnight

    Overnight

    No need to be testy.


    You already found one, which you have shown. So why not just use that one? Do you not trust it after it's 3-year run? At what point will a strategy become viable to you? Are you trying to find that holy grail that has no losing days?

    As you will invariably find, no system can have 100% winners without some caveat. I.E. Losing days. Math is math, and like all academia, it works on paper. Then the variable of the real world comes in and *poof*!, math folds like origami to the dynamics of real world application.

    The new variable that will come into your 3-year runs will be the election. No matter who wins, the dynamics of the market will change. For better or for worse remains to be seen.
     
    #47     Aug 30, 2020
  8. Tradex

    Tradex

    5% a day, that means you can multiply your capital... 200 000 times each year.

    Now we are way beyond the Twilight Zone.
     
    #48     Aug 30, 2020
    Amatrue, Bugsy and fan27 like this.
  9. gaussian

    gaussian

    I think we got him guys.
     
    #49     Aug 30, 2020
  10. Overnight

    Overnight

    What, you mean how he wants to make 5% per day, after stating the following about 8 hours ago?


    Indeed. Maybe FF is the right place for him.
     
    #50     Aug 30, 2020
Thread Status:
Not open for further replies.