Suggestions to Improve Automated Trading...

Discussion in 'Automated Trading' started by greaterreturn, May 4, 2008.

  1. Well, I've done many years of testing strategies for trend trading or channeling strategies.

    As to profitability, I found that:

    1. Strategies that focus on trends make a lot of money in some periods but large draw downs during non-trend periods which are 70% of the time with trends only 30% of the time.

    2. Strategies that focus on channeling make a lot of money during channels but suffer draw downs during trends. These strategies have over 60% or 70% profitability but they get hit hard during trends.

    In theory, you could combine these together so that when one has draw downs the other has run-up. But will that be profitable?

    It seems there should be a clever way of figuring it out when to switch between the strategies.

    So if a trend strategy is making profits, temporarily stop the channel, etc.

    So that's the challenge I'm faced with right now.

    That's why I'm writing my own platform.

    Wayne
     
    #31     May 19, 2008
  2. maxpi

    maxpi

    You should look at Openquant, I don't think it has the data limitations of the other softwares.
     
    #32     May 19, 2008
  3. rwk

    rwk

    What you're talking about here is an adaptive system that adjusts to changing conditions. It sounds good in theory, but is difficult to accomplish. The biggest problems seem to be the added complexity, difficulty of back-testing, and problems around the boundary when it is not clear which phase you are in.
     
    #33     May 19, 2008
  4. tommaso

    tommaso



    Hello Wayne,


    I have given up regarding these 2 above as 2 opposite situations where to play 2 distinct strategies.

    Channels are just an optical "illusion" due to short timeframe, and at the same time one can say that also "trends" are an optical illusion to sufficiently large timeframe. They part of the same thing.

    So there is no point running breathless after the market. Let the market come to us!

    Put in place your probabilistic "cage" and make sure it's well tuned to to turn the odds in your favor, no matter what.

    Another topic I do not see much talking around is the importance of choosing a well balanced portfolio.

    Would we put together in a race a racehorse and a donkey?

    That is crucial to keep drawdown under control and being able to build a good probabilist cage for our profit.

    Other absolutely crucial matter is the way we take profit, which imo must always be done in an indirect way, by not trying to freeze the magic moment when it is achieved, but postponing it in approprate forms of trailing profit lock, so we have all the time to appropriately adjust the lock while letting the profit run, if they want to.

    Tommaso
     
    #34     May 19, 2008
  5. rwk

    rwk

    I have a very short-term ATS that lets me dial in how many stocks I trade at one time. Both in back-testing and actual trading, the fewer stocks I trade the higher and lumpier the return over time. The more stocks I trade, the smoother the return. This seems to be consistent over time, and other traders have noticed it too. It's a matter of personal preference what mix you choose. I sometimes have trouble deciding, but I tend to favor smoothness, especially as I get older.:p
     
    #35     May 19, 2008
  6. tommaso

    tommaso

    Your experience agrees with the general theory which says that the mean of the mean (profit) of n random variables (say your folio P&L) is equal to variance / n

    (http://davidmlane.com/hyperstat/A13660.html)
    (http://faculty.uncfsu.edu/dwallace/ssample.html) etc.

    [imagine that the variance is about the P&L "volatility". In our case however volatilities and mean prices are different for the various stocks, and this makes things more complicate]

    By adding stocks, the global result distribution tends to become smoother, the possibility of a brutal folio drawdown becomes more remote, as well as the possibility of an extraordinary profit
    in the short period.

    Tommaso
     
    #36     May 19, 2008
  7. Interesting. I have my platform built to test tick strategies going back 6 years.

    I'm testing a random strategy whereby it trades a random number from 10 to 20 trades per day at random times and random directions.

    It stays in each trade till it hits a profit target or a stop loss.

    I'm only testing 2 random seeds right now.

    My discovery is that different stop and target amount drastically affect the level of profit.

    For example a 10 pip stop with a 20 pip target losses massive amounts of money. So do smaller ones like 5 pip stop and 20 pip target.

    However, a 50 pip stop with a 100 pip target makes a lot of money.

    NOTE: I'm using 2 random seeds. That makes the trades repeatable while I was testing my code to get all the bugs out.

    FYI: It only trades during the 8 am to Noon pm EST time frame and exits at the end of that "session".

    So here's my idea. Random tests appear to be a great way to test out a particular exit strategy minus the affect of an entry strategy.

    I'm thinking of the following, run an "optimization" test of a range of stop and target amount (or other exit strategy ideas) AND....

    test each iteration 50 times and take the average results for each one.

    So to try 5 pips to 100 pips stop loss in 5 pip increments.

    The other variable could be a range of target profit as a multiples of the stop from 2 X to 5 X step by 1.

    So that makes 20 X 4 or 80 iterations X 100 each or 800 iterations.

    I could capture for each one the risk/reward (max run-up/max drawdown), positive expectancy, and a few other parameters.

    My PC averages 4 seconds per iteration so that would be a little less than 1 hour to test.

    After having a "beat the odds" exit strategy, I could then find a "beat the odds" entry point.

    Please share any thoughts you have about this experiment.

    Sincerely,
    Wayne
     
    #37     May 21, 2008
  8. maxpi

    maxpi

    Strategies that are in the market all the time don't have stops at all except maybe disaster stops or end of session. I'm favoring that approach and feel that probably it is the best overall. Maybe all the questions about stops and the great difficulties encountered by many traders are really due to the idea that being in all the time and trying to be on the right side of the market is easier than trying to figure entries and exits...... You have to recognize a trending market and a sideways market and trade appropriately, not an easy feat necessarily. Having said that, some really experienced traders lean more heavily on time stops than other kinds.... When I did use stops I was favoring sort of a combination time and TA stop, like "after N bars and when bar color changes" or "N bars then a trailing stop". I don't recall that it was great but it's an idea anybody can try out..... I, and others that test a lot of strategies just never could make good use of trailing stops by themselves, it seems counterintuitive, they look to be so practical, but typically I would find that once optimized they gave up too much from the peak gain of the trade or kept a position from taking good advantage of a trend.....

    Happy trading to all btw......
     
    #38     May 22, 2008
  9. tommaso

    tommaso

    Hi greater

    my esperiments with stocks seems to indicate so far that the best ratio is 4:1. But it's crucial the absolute value of the loss threshold, which must allow for normal volatility, and at the same time not to be exagerately tolerant.

    I am not sure why it's so, because actually according to some computation I have done based on geometric brownian motion properties, it should instead be 8:1. The 2 best ratio should be 1:10 and 8:1. But the first one is practically untradable and very dangerous in case of disconnections.

    In any case the latter ratio would be unfeasible in intraday trading and would force us overnight.

    And probably, as stated in the previous comment by maxpi, the best absolute thing is to stay in the market all the time, resuming everyday, although I still have to do simulations on this (the open gap can *perhaps* interfere, although a folio could mitigate this effect).

    Other thing I can share and perhaps suggest is: do not take profit at a given level, but use a "traling lock": this seems to improve any strategy and "dominates" any same strategy which does not use it, according to my experience.

    Could you confirm whether the ratio above and the traling profit lock works fine with forex also?

    Tommaso
     
    #39     May 22, 2008
  10. What's a trailing lock?

    Also, using a random entry, it seems silly to operate that without a stop loss of some kind.

    Why? Well, my random strategy WAS at first REVERSING the position when a the next random time to trade was hit.

    But it frequently reversed in the middle of a winning position. Dumb.

    So the random strategy allows a trade to go till it either hits the TP, SL, or end of session for the day.

    In other words, it seems silly to operate it now without a stop or use an opposite ratio of stop to target. Because it will run till it hits either one.

    I forgot to exclude entries during the last hour of my contrived "session". My experience show it's not worth the risk to enter a new trade in the last hour statistically because the potential for profit in that limited time doesn't warrant the risk.

    Finally, my plan after testing the best TP and SL is to then convert to test a trailing loss instead of a TP with the SL.

    Why? Obviously, that's in the spirit of let your profits run.

    My preference for trailing loss is to ONLY initiate it once it hits target price and then move the stop up very tight.

    The IDEA is this: Most of the time, good moves during the day continue till the end of the "session".

    This allows the profits to run just in case the target was during a big surge. But if not, it gets stopped out quickly.

    Wayne
     
    #40     May 22, 2008