Random Trading

Discussion in 'Automated Trading' started by Loki45, May 19, 2010.

  1. Loki45

    Loki45

    I hope someone can help me solving this mystery:

    I wrote a little trading program that enters and exits trades randomly, without any parameters. That means, the program chooses the direction randomly, enters a trade after a randomly chosen time, and exits it after a random time. I tried it on several futures, and it consistently loses money, never wins over any significant number of trades. The only "parameter" is the maximum time the random generator can generate before the next buy/sell action.

    Why would a strictly random controlled program not produce results that are about break even, at least after a statistically significant number of trades? Instead, with waiting times randomly chosen between 1 and 60 seconds as an example, trading one ES contract results in losses of several $1,000 per 24 hours consistently!
     
  2. LeeD

    LeeD

    Commissions and bid/offer spread are a key element of P&L for short-term trades.
     
  3. Paul Rose

    Paul Rose

    Assume a completely stable market with deep liquidity in your instrument of 10.00 bid by 10.01 offered.

    I am assuming that you are actively entering/exiting (i.e. not passive non-marketable limit orders that you wait to get hit).

    Your (randomly timed) market order BUY (or immediately marketable limit) will always fill at the 10.01 offer.

    Your (randomly timed) market order SELL (or immediately marketable limit) will always fill at the 10.00 bid.

    You lose 1 cent per share per turnover.

    Now add in market movement -- sometimes a turnover will win, sometimes not, but there will still be bias toward losing the bid-ask spread on each turnover.
     
  4. olias

    olias

    assuming commissions are not factored in, the reason is the bid/ask spread. If you buy a contract and sell a contract simultaneously (for example) you are already losing the spread between bid and ask.
     

  5. -$1K/24 hrs regardless of #trades? what's the largest/smallest #trades/24hrs in your experiment? if this is the case comm and bid/ask is not the explanation.
     
  6. Loki45

    Loki45

    Commissions are not an issue, was trading on simulator. In real live, they would do an overkill, that's for sure.

    Concerning the bid/ask spread: I thought if your average wait time before you close a trade would be sufficiently large to give the price a chance to move away form the entry would solve that issue (on average), but on second thought, that might not be the case. I could introduce an additional condition, like the price must at least be two ticks away from the entry before the trade can close. But that takes away the random set up of the experiment.

    What I also could do to overcome the bis/ask issue is to introduce a minimum duration of the trade, like one minute or so, or 50% of the maximum time allowed. In my first set of experiments the minimum time was one second only, and with market orders (that's what I did), I had lots of trades executed zero or one ticks away from the entry.
     
  7. i misunderstood that you always losing the ~ same amount regardless of #trades. that would be a very interesting result.
     
  8. LeeD

    LeeD

    also read this story about a random-entry system.
     
  9. olias

    olias

    regardless of the time you wait before exiting the trade, the bid/ask spread is always a factor. It doesn't go away or minimize over time. Over the same number of trades the bid/ask spread should factor into the results the same
     
  10. If it consistently losses money, program it to trade in the opposite direction of the parameter.
     
    #10     May 19, 2010