Live data from Hacker News

Using an automated day trader to generate income

fattyfatfat.com

61–70 of 98 posts

Re: Using an automated day trader to generate income

#61
I'm the CTO of a startup named QuantRunner Software, where we write backtesting software, (beta coming this month) http://quantrunner.com . I found the article interesting, but it leaves out some important details such as

1. Why did he decide to enter into this strategy at 10:45 am on October 15th? 2. What would the outcome of the same strategy have been if it was left running for the next month, for the past year, for the past 10 years.

I'm curious.

Questions about how the backtest was run.

1.How do you get your data? 2.you seem to have written an excel spreadsheet to run the backtest, what's going on with that? How did you design it?

For other people on HN, does anyone here use backtesting tools? What do you think of the existing software you use?

Re: Using an automated day trader to generate income

#62

And lastly: I wrote a lot of that just as I was figuring things out, so I don't know how much of that I still stand by. But this morning, I wrote the one thing that I'd recommend to anyone who is interested in this sort of thing. http://fattyfatfat.com/2008/12/moving-average-crossover-theo...

I read through your posts but I didn't see whose data you used for backtesting, did you use Interactive Broker's?

Re: Using an automated day trader to generate income

#63

Earlier quoted context omitted.

you're right. and i ran it until it started losing. I announced the day i quit running the basic moving average crossover algo. I still dabble with variations of it (made like 250 bucks last friday), but I'm now doing way more research and backtesting before I drop things into the market for real.

on that note, i lost over 1000 bucks a day for 3 days straight, which is when i quit. and on having the "secret sauce" to beat the market. Read about Edward Thorpe. He's a badass. He wrote the book "beat the dealer" which was the bible on counting cards and beating vegas at blackjack. Then he figured out how to price options (convertibles, really) and made a killing in his own hedge fund (Princeton Newport Associates…

Check out "My Life as a Quant" by Emanuel Derman http://www.amazon.com/My-Life-Quant-Reflections-Physics/dp/0... and this book about Fischer Black's (of Black Scholes) work in finance. http://www.amazon.com/Fischer-Black-Revolutionary-Idea-Finan...

Re: Using an automated day trader to generate income

#64

Earlier quoted context omitted.

on that note, i lost over 1000 bucks a day for 3 days straight, which is when i quit. and on having the "secret sauce" to beat the market. Read about Edward Thorpe. He's a badass. He wrote the book "beat the dealer" which was the bible on counting cards and beating vegas at blackjack. Then he figured out how to price options (convertibles, really) and made a killing in his own hedge fund (Princeton Newport Associates…

What's the merit to publishing a successful algorithm? Or using a previously published algorithm that any hedge fund manager or resourceful individual can find and implement trivially.

A better question is how do you know your algorithm is successful? If it predicts correctly 10 days in a row, have you got a winner? It's like those guys that advertise by saying "We outperformed the market by 6.2% on average the last four years." Put enough monkeys in front of a trading terminal and you're going to have some that outperform the market by 6.2%; doesn't mean you should invest your money with them.

Re: Using an automated day trader to generate income

#65
A year ago I embarked on a project to learn Common Lisp by building a trading system, to execute with the Interactive Brokers API.

I modeled the woodiescciclub.com trading strategies, primarily because the math is simple and the patterns are well defined. However since then I've seen other parties on the web talk about how the Woodies patterns actually don't make money consistently, although I didn't corroborate this.

I actually found CL to be a fantastic language for this. I was writing up the Woodies patterns using a DSL I had created:

  (defpattern zlr "Zero Line Reject" :with-trend
    ((count 1)    (within  100  250) (trend :up :or-opposite-invert))
    ((count 1)    (within  100  200) (trend :up :or-opposite-invert))
    ((count 0 10) (within  -50   99) (trend :up :or-opposite-invert))
    ((count 1)    (within  -50   50) (trend :up :or-opposite-warn) (angle :down))
    ((count 1)    (within    0  115) (trend :up) (angle :up) (away 8)))

  (defpattern hfe "Hook From Extreme" :counter-trend
    ((count 1)    (within  200  300) (trend :up))
    ((count 1)    (within    0  199) (trend :up) (angle :down) (away 3)))

   ...etc
The defpattern macro was creating, for example, #'is-zlr, #'is-zlr-up, #'is-zlr-down, which were then used by a trading engine that monitored 5-minute bars on a given futures contract and launched trades.

Another CL feature, restarts in the condition system, helped too. When the data feed broke or got corrupt, an exception thrown which could reload the data feed and restart back in the listening loop without forgetting any context was helpful.

Also just running in a Lisp image was great because I could swap functions during a live feed without stopping the program.

In the end, the programming worked great, but the trading system lost money. I had it working in backtesting over a few months and then papertrade mode for weeks, and then when I took it live, the volatility rose and it started hitting the stop all the time. I adjusted things like stops based on ATR, but I really just ran out of my little budget to play with it.

It did however teach me CL. ;-)

Modern trading platforms have built-in tools and programming languages and writing things from scratch in CL is really just an academic exercise.

I believe it's possible to do algorithmic daytrading, but quite a bit more difficult than it seems. There are way more market behavior modes than you can appreciate at first, and the keys to success lie more in counterintuitive aspects of your system like position sizing rather than intuitive aspects like entry strategy.

The best talk I heard from someone on the subject indicated that it takes years and the end result is a fairly sophisticated algorithm-switching engine, because the hard part is just to survive.

Re: Using an automated day trader to generate income

#66
post #55

Earlier quoted context omitted.

Your `boolean` has 4 values? Most languages I am familiar with require booleans to be either TRUE or FALSE, although I have met a few where undefined or NULL are possible values.

It returns true in all 4 cases.

mktStatus is always true and he defined 4 values for it?

:P

Re: Using an automated day trader to generate income

#67
post #34

Earlier quoted context omitted.

using past performance to estimate future performance simply does not work This is not always true. I had a theory a few years ago that went like this: The price of a stock is a direct function of the perceived price of the company multiplied by a risk factor: The more risk the less the stock is worth. On the day the yearly report is publicised for a company the risk is big just before the publication because nobody…

The problem is that the market is dynamic and chaotic. Measuring past data doesn't give you much indication of how much your algorithm would have made, even in hindsight, because every buy and sell you would have executed would have changed the market and the future. Even relatively small orders can have big ripple effects, especially if they just happen to trigger standing limit orders. Genuinely measuring the marke…

Good point. As pointed out on the rest of this list, you should be very careful about "data mining", where simply finding a strategy that works on historical data may not be replicable. Also, some strategies work well in some markets (like high volatility) and poorly in others. I think a next level of analysis is trying to figure out when to turn particular strategies on or off.

As for the attacks on technical analysis, many practitioners probably are deceiving themselves that they've found some secret sauce. However, since the market is made of 100% of the people who transact in it, the presence of technical traders means that there must be some price movements as a result of these trends. One ideal would be to find a strategy that beats other technical analysts to the punch. A lot of people use the 12/26 MACD, but maybe the 11/25 MACD would help you eat their lunch before they entered the market...

It is all very tricky and takes a lot of discipline to avoid fooling yourself and getting into real trouble. Also, people need to make sure to focus on both sides of the trade - you only book the profit once you've actually sold the position (most people seem to be much more focused on entries than exits)

If anyone is interested in this kind of software but aren't so into learning a new language (perhaps less applicable to this group), you should check out QuantRunner Software http://www.quantrunner.com. In full disclosure, I am the CEO of the company, but we really focus on making this kind of back testing analysis easier for people to do without programming experience. We also have some novel tools for helping people actually improve their strategies, rather than simply iterate tests. If I had the true answers on the best strategies, I probably wouldn't run a software company. All we hope for is to make it easy enough for people to do their homework without having to worry about coding errors as well as poor strategies.

Re: Using an automated day trader to generate income

#68

Heh, so this has piqued my interest. I have absolutely no experience in online investing/day trading, although I'm pretty sure a lot of you are veterans. Any books you'd recommend to a programmer with day trading aspirations?

Yeah, don't daytrade. It's a sucker's game. The market is too close to efficient for you to recoup what you lose in brokerage fees and excess taxes. Fund your IRA to the max, and if you're 20+ years from retirement buy all ETFs with low expense rations. If you're closer to retirement, buy fewer stocks and more t-bills, etc.

Its hardly a suckers game if you know what you are doing. I know prop traders that make huge bank essentially daytrading on the forex and others.

Sure, its highly controlled gambling, but you of all people should realize that its not a losing game for everyone. If anything, its just a suckers game for small timers -- like all other gambling.

Re: Using an automated day trader to generate income

#69

Earlier quoted context omitted.

http://www.amazon.com/Technical-Analysis-Financial-Markets-C...

http://fattyfatfat.com/2008/10/automated-day-trader-most-tec... I still stand by my above claim that Tech Analysis (and especially LONG term trending) has no theoretical basis, except for the fact that everyone else believes in it.

regardless of whether it has "theoretical basis", there are plenty of hedge funds that make plenty of money with it.

Re: Using an automated day trader to generate income

#70

So, the obvious question for me is where can I buy stocks for $2.40 per trade? Any day trading successes I might manage would be eaten up by transaction costs at my current broker (where trades are $9.95, I think). I'd probably be a far more active trader at $2.40 (which may not be a good thing, but cutting costs is always good).

$3/trade at SogoTrade
Post reply on HN