An Interactive Backtesting Development Example

Discussion in 'Strategy Building' started by Argent, Aug 16, 2011.

  1. Argent

    Argent

    My turn to pick on you. I trade intraday mostly for fun using play money, expecting to make my sub 4% returns from investing my real money. Are you doing the same thing? Otherwise why daytrade at all for your sub 4%? Not knocking your returns, I know how hard it is to make ANY fucking money trading index futures. And I would kill for your drawdown, very impressive.
     
    #21     Aug 17, 2011
  2. Pick all you want. You mean sub 4% monthly? Yes, this is a daytrade account, equities only. I trade ES/YM and Treasury futures in a different set of accounts, much more return volatility in those accounts.

    Being at cash every night is very attractive to me, hence I am not subject to any large drawdowns. I also don't use very much leverage either

    This particular model's risk parameters are a function of drawdown. I don't want >15% drawdown, hence my returns are a function of that. I could set it up to go for 10% avg monthly, but, I'd be subject to a potential 40% drawdown. No way. There is no free lunch here. Also, as anyone who has been in this business long enough knows, there are serious risks with larger equity position sizes. Hence all my position sizes are tiny.
     
    #22     Aug 17, 2011
  3. Argent

    Argent

    Sorry. Misunderstood that the return was monthly and the vehicle equities. Well done!

    Re cash, I only keep enough to trade with, the rest not in equities is in T-Bills.
     
    #23     Aug 17, 2011
  4. Sorry Argent (or anyone to answer), don't mean to catch you off guard with a serious response, it's just my sense of humor is not very good; people usually don't laugh at my comments, just respond with dirty looks

    I'll describe-code this instead of real code, because my app is in C#, not eSignal.
    I've seen these coded in 2 different styles:
    1) compare the highs/lows/opens/closes simply with greater than or less than signs ( < and > )
    2) do some more math to check the highs/lows/opens/closes differ by some fixed or percentage amount
    3) use some indicator values

    which one do you use?

    Since this is "interactive", here's my noobie guess:
    For a retrace, I'd code as:
    - the opening bar (or 2 or 3) moves away from the day open by dMoveAway amount or percent
    - then the next couple of bars hang or stall or range (defined as the highs and lows do not exceed dHighRange and dLowRange amounts)
    - then in the next couple of bars the low or high gets within dNearOpen amount or percent of the daily open
    - more code to figure out if the retrace was coming down or going up
    - more code to test if the trade should be in direction of the opening move or the retrace direction
    - run backtest, interpret results, look for win/loss ratio, win/loss amounts, drawdown, effect of changing parameters, OOS comparison, and more

    Looks like I'm in the #2 style, checking differences by some amount.
    Indecision: should it be #1 style, for simplicity, but with no shape? Or #2 style, to better define the shape, but with more parameters that risk curve fitting? Always interested to hear other ideas and perspectives.

    thanks
     
    #24     Aug 17, 2011
  5. Argent

    Argent

    The way you do it has to match your temperament and your personal concept of what constitutes a retrace. I use eight tests coded as function calls, one short and one long test of each of:

    1 point exact test
    2 point exact test
    1 point bracket test
    2 point bracket test

    If the particular pattern being tested often exhibited other behaviors, like requiring a 3 point exact test, I would add that. So I'm with you in style #2.

    I can handle serious today because I am almost blind from watching a one-second chart all day this fascinating day.
     
    #25     Aug 17, 2011
  6. Yes... the sound of crickets chirping. Where's your s**t Bill? I really don't care what it is, just let us know that you're not all bark.

    Here's the thing; I enjoy discussing anything that relates to trading. I enjoy the concepts that Bill uses because I am genuinely interested in them, but, there is a problem here: I have to make money, it is my job. Mental masturbation via chasing mirages is all good and fun, but, if the end result doesn't pay the bills, then what's the point?

    Also, Bill, there is no use in acting like you're smarter than everyone else. You won't make any progress that way.

    So, here we are again Bill, how do you seperate a good concept from a bad one? Do you review the trades and say "Hey, that was a valid entry?" Do you ask yourself if the underlying logic makes sense?

    You say you combine these systems, yet, earlier you gave me a hard time about MPT. I claimed that the main idea is combining non-correlated assets(systems), and you said I was wrong (B. Mandelbrot agrees with me on this point by the way). Have you read his book? How do you study the correlations of your systems? How do you apply common sense to overall risk assessment when the underlying entry/exit logic is found via "fuzzy" learning?
     
    #26     Aug 17, 2011
  7. Argent

    Argent

    As entertainment while your nemesis builds his case, ask yourself how you would justify spending time algorithmizing, coding and testing, nay even trading, systems that you DREAMT? That doesn't even qualify as fuzzy.
     
    #27     Aug 17, 2011
  8. I like that question.

    Will have to think about it for a while. But some waffling off the top: often dreamt of having a full options database + all EPS releases going back 30 years... I have looked into purchasing this stuff and I am still a cheapskate in that sense.

    Building an options backtesting platform would be a dream. In another life I was a pretty good engineer and maybe I would've had the energy then, but, I've turned lazy in recent years, and I never had software skills to begin with. The laziness is probably a result of too much red wine in an attempt to deal with PnL swings :).

    I've dreamt of being able to trade volatility 100% automated over a large options portfolio... there is soooo much to be delved into there its overwhelming.

    So that has been and still is an unrealized dream; how the hell do I build an options database, an options backtester and automate a shitload of positions? Then do all the risk management on top of that??? Its scary. Maybe one day I'll work with a staff of compSci geeks and get it done right...

    Bill isn't my nemesis (altough I admit it looks like that), I just seem to really rub him the wrong way (mental masturbation, pun intended); probably all that waffling I do. He's just a touch emotional too. I do pick on him here and there because he displays little humilty. A solid percentage of his posts are actually worth reading, if one can get past the "I'm smarter than thou" tone.
     
    #28     Aug 17, 2011
  9. In terms of justification, well... I think that comes back to personal preference. I'll test just about anything given I can get meaningful results in under 1 month (live trading excluded, maybe 6 months of live before I start putting down solid cash). The fundamental concept has to be solid though... no shortcuts in that sense.

    That's an art... I think.

    Let me ask you a question, suppose you had that return profile I posted and 100K in equity, what leverage would you trade it at? Assume those stats are based off of about 1.5x leverage as they stand.

    Same question, but how about for 5mil in equity?
     
    #29     Aug 17, 2011
  10. Argent

    Argent

    I am not a good person to ask. In daytrading I use futures leverage. So my view is daytrade with as much leverage as you can get as long as you stay on top of it all day. With futures leverage and $100K and your returns you would quickly find out the limits of scale. I daytrade NQ solely and 50 contracts dimples the market, 200 moves it. $5M in equity? I would fucking drop out! More than I could spend in a couple of lifetimes. But I think with such a grubstake you are better off position trading stocks and commodities with a timeframe of months.

    Re your options dreams, why not seek an angel who shares your grand vision but needs your intellectual horsepower to achieve it?
     
    #30     Aug 17, 2011