Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

Albnd

Members
  • Content Count

    20
  • Joined

  • Last visited

Posts posted by Albnd


  1.  

    Kelly is supposedly what Larry Williams used.

     

     

    The Kelly I had in mind was the "revised" formula proposed by this guy:

     

    Quantitative Trading

    Quantitative Trading: How to Build Your Own Algorithmic Trading Business (Wiley Trading): Ernie Chan: 9780470284889: Amazon.com: Books

     

    [ame=http://www.youtube.com/watch?v=LJIwxiMxbaw]Ernest Chan - Capital Allocation and Risk Management (Kelly) - YouTube[/ame]


  2. Sure, Albnd. I first figure the Kelly number for each system (and sometimes for both longs and shorts separately). Kelly was originally developed as a gambling approach for bet size. It tells you the % of your total capital you should risk on each bet (or trade) to maximize your total gain without going bust, assuming you know the Win % and the Win/Loss ratio, and that they do not change going forward (which of course they will in trading).

     

    I then take a percentage of that Kelly number (say 15% of what Kelly says I should risk - this is usually determined by modeling a given system and seeing what the drawdowns would be given certain percentages of Kelly). Then I set the maximum risk of my total capital to that amount on every trade that particular system places.

     

    For example:

     

    1. I first caclulate the Kelly for the system, as shown below. Let's say it works out to be 30.2%.
    2. Then, I pick a pecentage of that number to test. 15% of 30.2% Kelly would be a 4.53% risk per trade (.15*.302=.0453). I keep testing different percentage of Kelly until I find one that gives me a balance of profitability and drawdowns that I like. (To give you an idea, my total portfolio of systems gives me drawdowns of >40%, but I'm comfortable with that. So choose a drawdown that you can handle and be conservative in this estimate because the drawdown will be larger than in testing or history.)
    3. So, then I take total capital times percent risk to get my total $ risk per trade. Say, $100,000 total capital * 4.53% = $4,530 total risk per trade.
    4. Then I find my stop loss per contract on the next trade. I always make my stop loss dynamic, rather than a set amount, by setting my stops a certain percentage of recent volatility away from my entry. ATR (or higher timeframe ATR) works well. Let's say in this example that it's $500 per contact.
    5. Then I just divide total capital risked by stop per contract and round down: $4,530/$500 = 9 contracts.

     

    So, what happens is you continue to risk the same amount of your capital on your system on every trade. If you make profits, i.e. - more capital, then your quanitity will rise; if you lose money then it goes down. I try to always think of profits and losses as percentages rather than dollar amounts. That makes all trades (regardless of equtiy) comparable. Hope that helps.

     

    From Investopedia:

    There are two basic components to the Kelly Criterion:

    • Win probability - The probability that any given trade you make will return a positive amount.

    • Win/loss ratio - The total positive trade amounts divided by the total negative trade amounts.

     

    These two factors are then put into Kelly's equation:

    Kelly % = W – [(1 – W) / R]

     

    Where:

    W = Winning probability

    R = Win/loss ratio

     

    Thanks for your clarification. The Kelly formula I was aware of suggests to discard part of the porftolio according to some specific equity conditions. As far as I understand, this is not your case. Am I missing something?


  3. Trade on sim until consistently profitable for 6 months. That will remove the possibility of financial losses. The remaining risk will be time loss. There is no easy way to remove that one. When a strategy (manual or automated) works and you're sure it works, run it real time on sim for 6 months to make sure it doesn't stop working.

     

    I can easily show that your 6 months won't demonstrate anything, my friend. And won't give you any certainty about not losing money, that's for sure.

     

    I think it's a very realistic view, and the very few profitable traders I have known have agreed with it.

     

    I've learned to trade profitably (not insanely so, but positive) manually using my brain. Modeling everything I do into an automated strategy would be way too complex. There are so many inputs and factors and they're constantly changing. And if it could be done, then one could slowly work up to 1000 contracts and make millions. Wouldn't every fund in the world be working on such a thing?

     

    But I don't want to argue this point because people coming into trading are chasing their dream and they don't want to believe it's not possible. So when someone tells them the odds of succeeding are 1 in 10,000 they either believe that's not true or they believe they'll be the one who will make it.

     

    This is WAY too simplistic.

     

    On a statistical basis, saying that 95% of trader will fail (no matter what method they follow) would be much more realistic. But what's the point of stressing that?

     

    (Serious) automatic trading may involve the use of "your brain" much more than manual do. Maybe you were not aware of this, and are now projecting your experience onto a wider spectrum of "general" experiences. You're not supposed to generalize your conclusions simply because this approach didn't work for you.

     

    Once again (you didn't reply to that): have you performed all the required tests before and after your trading activity? Were all the calculations made in a statistically reliable way?

     

    P.S. FYI, I'm a 10-year pure mechanical trader, and I'm profitable. And I'm not a genius. So, what's the catch?


  4. It didn't work. :evil tongue:

     

    The answer is yes optimizing profit target & stop loss is curve fitting, at least to an extent. If the stop and target are just random numbers that are optimized then it's curve fitting.

     

    I'm now working on a semi-automated strategy. I put in my levels and the basic idea and my strategy picks entries & stop loss. Since it uses my levels which are done manually, there is no backtesting and so no optimization. I've only been doing it for a few weeks and I'm working out little bugs but so far I'm encouraged. Market action wasn't great the past few weeks and I only run it the last 3 hours of the trading session so it'll take a while longer to get enough data.

     

    So if anyone is interested in automation.. I do not believe it's possible. The markets change. high volatility, low volatility, trend days, balanced days, etc. I've never seen anyone have a successful automated strategy long term, at least without massive drawdowns that would cause most to pull the plug. I think the best route is to give up trading, but if that's not an option, it's best to learn to trade manually and then look to automate parts of the trading slowly.

     

    That's a too pessimistic point of view, IMHO. I think that a better question would be: have you realized WHY your strategy didn't work? You just generically mentioned market changes, volatility and so on. Did you quantify the overall and range-specific reactions of your algorithm to market windows and regimes? Did you take note (with your metrics at hand) of every single interaction between the market and the results you've got?

    Very often automation is abandoned only because of lack of a proper analysis.


  5. Hello Friends,

    Thanx for all your comments and advices . since the past few days I had been experimenting with 3 different TA Softwares ...Sierra Chart,Amibroker & Ninja Trader . Ninja Trader & Amibroker certainly has a better look and feel than Sierra Chart . Amibroker in particular...the charting looks highly sophasticated with tons of drag & drops . But in spite of all this I have decided to stick with Sierra Chart bcoz of 3 reasons

     

    i) The Programming Language used by Sierra Chart is C++ which I am used to . Ninja Trader uses C# which has very little in common with C++ excpet for the letter C . C# uses an object oriented structure which is very similar to Java and I hate Java :) ..... And I certainly dont think its worth taking the effort to learn a new language in AFL for Amibroker and also did not like the small notepad like editor which comes with it to write and compile AFL

     

    ii) I can combine excel and C++ to manipulate my data in Sierra Chart which is an added advantage

     

    iii) The online documentation for Sierra Chart is exceptional . Very informative and resourceful for beginers and developers . Only drawback is that they dont provide that in pdf .

     

     

    Vince

     

    Keep us posted about your progress with this software.


  6. I would definitely think about how you can remove variables from your system so that there is very little optimisation to be done.

     

    I would possibly comment on this, even if the thread is no longer updated.

     

    On another forum I had the occasion of discussing about the usefulness of optimizations and especially of walk forward optimizations with reference to the INS/OOS balance.

     

    My point was basically as follows: WFO is probably NOT always a must in comparison with traditional optimization. In particular conditions of market and time, there's a chance that a WFO is NOT necessary and/or useful.

     

    Just a specific case, to make my point clear.

     

    I’m currently testing a (purely automated/mechanical) strategy with very few parameters, and most of them seem to be unrelated to any kind of periodical change in the market I‘m trading (QM futures contract). I basically started asking myself: is it necessary/useful to include these parameters in the optimization, if they don’t seem to be correlated to any specific change in market behavior? (i.e. they basically seem to casually change from one period to another).

     

    One of my mechanical strategies uses a fixed stop loss and evaluates the opening session gap size before taking action. I would usually prefer to set the stop loss just once, by considering the general MAE of the historical backtest. As for the gap size, I usually cannot see any particular change between the sizes of 2002 gaps and the ones related to today’s markets (I can provide data for this). So, does it make sense to include these parameters in the optimization?

     

    I agree with your suggestion about reducing the number of the parameters. In fact, my point is that a specific optimization may not be needed for strategies that have very few variables/parameters.

     

    By the way, I was replied that in most cases even a strategy with no parameters at all can hide an "implicit" (over-fitting) adaptation to the markets because of the way it's programmed and conceived.


  7. Hi Albnd,

     

    Welcome to TL - mechanical traders are a little under-represented here, so I look forward to seeing you around the forums!

     

    Kind regards,

     

    BlueHorseshoe

     

    For sure. Honestly I feel a bit confused, 'cause the forum is really huge. Do you know of any specific "place" (thread, etc.) related to mechanical trading over here? Any orientation is welcome.

     

    Thanks.


  8. 1. Why

    I'm trading to make money, possibly as a career. It's an hobby, but it's also something more than a hobby. I have a job and don't depend on trading for my daily expenses. However, even if money is not a goal in itself, to have an additional income is my basic motivation. That's a major thing that presently makes sense to me. And yes, trading is also a good gym to motivate yourself in many things of your own life.

     

    2. Commitment

    I'm currently spending 6-8 hours a day to learn and improve my trading. I'm lucky because my family supports me in that (well, till now it worked at least...).

     

    3. Timeframe and method

    Basically intraday (5m, 30m charts), 100% mechanical trading system. Using mean reversion, breakout, gap trading strategies.

     

    4. Account/Investment size

    $20.000 spread in two accounts (futures, forex and equity).

     

    5. Money management

    I started apply a very profitable (but risky) strategy to CL contract, but had to move back to the more "quiet" QM because of the risk/reward ratio. I'm trying to keep my risk under control.

     

    6. Product

    Basically futures. Some stocks (especially in the past), but also forex pairs.

     

    7. Broker

    InteractiveBrokers and mainly TradeStation. In the next future will also open another futures account, to diversify.

     

    8. Platform

    TradeStation mainly. Had some experiences with MT4.

     

    9. News Source

    Don't do news trading.

     

    10. Computer

    I've just recently noticed that my quad-core 3Gram PC is no longer supporting my daily activity as expected. I'm planning to do an upgrade asap.

     

    11. Internet

    A regular ADSL connection. Using also my cell phone as a backup/emergency connection.


  9. I didn't post very often in the past few months (in fact I didn't post at all eheheheh).

    Btw, just my two cents: go mechanical, 100% mechanical, and possibly stay out of reach of your keyboard. If you feel tempted of changing every parameter you just included in your strategy, let the machine do all the work and stay away.

    (of course this will expose you to many other risks, like bad executions, software/power failure and so on... but this is another story).


  10. 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 form at all and so adaptability is essential for a trading system. By default it is equivalent to curve fitting because you are searching for ‘best fitting’ input parameters. In practice, you can use optimization results to model a more ‘adaptive’ system.

     

    Running an optimization can be the easiest way to look for parameters which the market favors in different phases or time intervals. A simple method is to map the changes in optimum input range with a market characteristic such as volatility or trendiness. This in turns helps to build a layer of adaptability or regime analysis which is essential for any trading system.

     

     

     

     

    Important Points To Avoid Curve-fitting

     

    • Simulations should be close to actual execution: Perhaps the most important aspect of backtesting/optimization is to avoid simulations which cannot be executed in practice similarly as the simulation. For example, in intraday systems, optimizing a strategy which takes profits which are less than 5 times of bid-ask spread will likely be meaningless. Similarly, for EOD systems using the optimized performance on 2008 to trade/test during 2010 can be unprofitable because there was a dramatic shift in trading regimes over these periods.
       
    • Premise based system design: A large number of input parameters or technical indicators lead way to curve-fitting. Using a premise-focused approach helps you keep the parameters minimum and the strategy simple. While modeling a strategy it is easy to get lost on the combination of entry/exit conditions; however, using this approach will help you to focus on the characterstic of market behavior that you intend to exploit in the first place, and which is essential to the ‘edge’ of the system. It is extremely important to code simple “elegant” strategies in order to avoid added complexity which will result in curve fitted solutions.
       
    • Sufficient sample data for simulation: This is a common adage in statistics; there is hardly anything to elaborate. If the period for which the system is tested is small enough, you may need to test it across a large number of symbols. The (expected) number of trades on which the optimization is performed should also be large enough. I prefer minimum 200 trades (ideally more than 1000) which may be tested on more than 100K bars of data. Small sample data increases the chances of curve fitting to a great extent.
       
    • Keep your system symmetric: One of the first ideas new traders have when they start system development is to have a separate criteria for Entry/Exit and Short/Long trades (for example using an indicator parameter 20 for long entries but 15 for shorts). This is because separate criteria increase the number of conditions (and degrees of freedom). If a system from profitability to losses depending only on complicated combination of rules it is less likely to be robust. Even though on daily time frame bull markets tend to have totally different characteristics than bear markets, it is better to have a long(short) only strategy than depending on complicated combinations. Also testing the same strategy over different time frames gives information about its stability.
       
    • Out-of-sample testing periods: A very common practice in system development is go for rolling backtests or walk forward optimization. Certainly the out-sample test doesn’t have to be profitable (as all strategies have profit and draw down periods) but it must at least hold correlation to the draw down depths and profitable periods seen in the past. As a general rule, if an out-sample test shows a MDD (max draw down) more than twice the previous MDD then the strategy may be curve fitted.
       
    • Sharp’ clusters in profits distribution: It is good to have a look at distribution of profits w.r.t. to the change in input parameters. For example, if input 24 gives profitable results but 23 and 25 are unprofitable then it means that the system is ‘instable’ between the input range 23-25. Such system will be unprofitable in actual trading because it depends on particular optimum criterion. Likewise if the system is profitable with input 40 and its profitability gradually decreases as the range is shifted >50 or <30 than it is much more stable with the parameter 40. From a trader's perspective, finding single sharp peak is useless for trading because that result would be instable (too fragile) and not replicable in real trading.

     

    Great, very nice post. Thank you so much


  11. Hello Friends,

    From my research on Internet and TL... my deduction is that most of the TA Softwares use their own proprietary Coding language . I was wondering if there are any TA software/Charting tools which uses C,C++ or Perl for coding and trading strategy design . I am planning on using IB as my broker and was looking for the right TA software to use as the backend preferably which can be coded using C, C++ or Perl .

     

    thanx in advance .

     

    Vince

     

    You may definitely want to give a look to NinjaTrader. If you're trading futures there are many brokers offering free data for backtesting and brokerage. The language is very similar to C# and there's plenty of extensions and components available here and there on the net. The integration with IB is provided via mail/popserver protocol, and it's usually working quite well.


  12. 1)Take everything you read with a grain of salt. That includes this post.

     

    2)Never pay for a system. It is just not that easy.

     

    3)If something comes up in your life that is distracting, stop trading.

     

    4)Plan every aspect of your trade down to the smallest detail, and plan for every possible outcome.

     

    5)Develop your own strategy. Don’t let someone tell you that you can’t trade a simple moving average if you truly believe you can.

     

    6)Test the strategy in the market that you will be trading. If you like the results, trade it in another totally unrelated market and see if it still holds up.

     

    7)Paper trading is ok, but there is nothing that truly tests the strategy like hard earned cash.

     

    8)You will have to make sacrifices in order to make it. I still do. In the middle of my learning period I was working 18 hours a day during the week and 12 on the weekend.

     

    9)You are responsible for everything when it comes to trading. That includes stop running, bad fills, limit moves, your PC crashing. I mean everything. See #4

     

    10)And last but probably most important, don’t be afraid of failure. Just do like Edison and go, “Well that didn’t work”.

     

    Good trading to you all.

     

    Very nice post. An inspiration, really.

    I would just add a #11 (or probably as a part of #3): trade if (and only if) you can do it. If the moment comes that you're supposed to stop, stop it immediately. There's some more in your life that requires your attention.


  13. Hi,

    I'm trading futures (CL, QM, ES, C) since 2010, but traded also forex and stocks for many years. I'm a 100% mechanical/quantitative trader, and I used to develop my systems on my own. I traded many strategies on TradeStation and NinjaTrader platforms. I'm currently interested in sharing ideas and projects on this nice forum.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.