Get the top HN stories in your inbox every day.
eggy
I have been working my way through a 2013 book, "Professional Automated Trading: Theory and Practice" that uses Lisp as the language to implement a trading system of different frequencies using concepts from artificial life and control theory (I recall studying all of the stuff coming out of the Santa Fe Institute in the late 80's - Artificial Life I, swarm intelligence, etc.). Some of the AI/AL stuff is dated, but the trading knowledge covered and how to build an automated trading platform are great. He covers a lot of ground very concisely and based on solid experience. I love Lisp, so that was also why I gravitated towards this book.
I am currently into the April programming language, Array Programming Reimagined In Lisp[1], and I may try to implement the mathy parts of the book's code in APL and the remainder in Lisp as presented with some improvements. April is very flexible and takes advantage of the libraries and symbolic processing of Lisp. The creator of April just switched it to lazy evaluation from eager evaluation last month.
rawoke083600
You had my upvote at Lisp :P
eggy
Ha, yes, Lisp is the strange attractor or gravity well I always flow back into after trying other PLs. Don't get me wrong, I like Zig (to replace my old C ways), SPARK2014 (which has achieved what Rust is evolving towards), and my other loves - J and APL. That is why April was a binary black hole - the joy of Lisp with a REPL, a lot of libraries and legacy, symbolic processing, and the ability to embed diamonds of APL in the parentheses for the mathy parts. I just have plain, old fun when I open up Lisp. Immediate evaluation and hotloading code with a great IDE/editor in emacs/sly. I am learning Xah's Fly keys[1] to bring it all together to satisfy my modal thirst from vim in emacs.
Clojure is a lot of fun too, and opens up a lot of libraries to use. Dragan Rocks[2] has some great libs for ML/DL
Mark Watson is the main culprit for writing his book and having the nerve to publish it: Common LISP Modules: Artificial Intelligence in the Era of Neural Networks and Chaos Theory[3] I had been superficially studying AI then - GAs, ANNS, chaos and complexity - back in the late 80s, and this book introduced me to Lisp. Mark is sometimes on here, so Mark, thank you!
[1] https://github.com/xahlee/xah-fly-keys
[3] https://www.amazon.com/Common-LISP-Modules-Artificial-Intell...
jwmoz
Not sure why a simple book review has so many upvotes.
A couple years ago I read all I could on this and started systematic trading on crypto. Ended up with the best results on a public platform and ran a small trading operation with a few clients, one a crypto market maker. It's really hard due to all the market unknowns, stress and psychology/emotion. After the FTX debacle I lost ~35% of capital. Currently put it on pause and back software engineering.
Had to rebuild my asset allocation system which was based on FTX api. Improved it to be realtime and using Binance api. There's still the counter party risk-Binance could get busted or USDT fraud.
Aromasin
It probably has so many upvotes because it's quite a novel topic for HN. You might not appreciate it as much, being in the industry, but algorithmic trading is a field most of us haven't explored. Most of the content on HN is focused on web design to be honest, so things outside of that can get quite a lot of traction.
jwmoz
Ah fair enough. For anyone interested I recommend Trading Systems by Tomasini and Stocks on the move by Clenow.
EricLeer
Do you have some recommendations on good books on trading systems? I work in the energy trading world, and in general the systems there are behind the financial world by ~10 years.
I hope to learn more about this topic!
jwmoz
Try Trading Systems by Tomasini and Stocks on the move by Clenow, Python for finance. For the code side there's not much ultimately you have to build it yourself and learn.
topicseed
How complicated were your algo trading strategies? And have you thought of translating these to non-crypto?
jwmoz
They were fairly simple, using simple maths or technical indicators, or simple pandas calculations depending on the system. They all generally were based on the momentum behaviour of markets.
The hard part is the backtesting and design of strategies talking into account the science and art of it. And the absolute truth that past performance does not dictate future results.
I haven't tried non-crypto, I think I will just leave that to simple investments in tracker funds or etfs.
TimJRobinson
Did you measure your returns in USD or ETH/BTC?
I've come across many profitable traders in Crypto who only measure in USD and when you compare their results to just buying and holding ETH/BTC at the start of the cycle they come out behind. Everyone feels like a great trader in a bull market.
jeffreyrogers
Their risk adjusted returns could be a lot better though.
andrewstuart
Anyone here making real money from algo trading?
I'm talking about people who write their own software rather than working for a company that does it professionally.
I'd be interested to hear any tips or pointers on what strategies you've found that work.
smdz
It works, but do not expect huge returns.
I have worked on multiple strategies. - Strategies using technical indicators do work, but you have to reasonable. If you find these giving higher than expected returns, or too many consecutive wins - take the money. Stop live trading and continue dummy trading - eventually there is a point where you can start live trading again. The thresholds will be determined from backtests.
- Statistical strategies work for swing trading. However, these are very difficult to figure out. Need a lot of data (for backtesting). These work consistently over a longer period and might look loss making over a small period.
- Scalping within 5-10 minutes works pretty consistently, signals based on options data.
- Understand and realise the law of large numbers, and use that to your advantage.
- Give importance to understanding the concept of Time. There is a whole lot of weird and scammy pseudo-science around it. Therefore do not blindly rely on one theory.
hungryforcodes
I do similar stuff and confirm most of the above. It matches my experiences.
The only other thing I'd say is that if you're in a bull market you may have easy wins. Then after -- when the market turns against you -- these will evaporate.
So long term you have to ask yourself if you are REALLY beating the market. If you'd bought Amazon or Microsoft instead, over 20 years you'd probably be far ahead.
reisse
> The only other thing I'd say is that if you're in a bull market you may have easy wins. Then after -- when the market turns against you -- these will evaporate.
If your algotrading profits depend on market being bull or bear, you're doing it wrong. Volatility matters, not the direction.
beagle3
> If you'd bought Amazon or Microsoft instead, over 20 years you'd probably be far ahead.
And if you'd bought pets.com, or webvan, you'd be far behind. Survivor bias at work.
dachryn
I dabbled in this myself, and never managed to beat a classic index tracker.
So yes, I made a 3-5% profit over roughly 18 months, but it took a lot of time, stress, and in the end I ended up with less money.
Is your experience the same?
boshalfoshal
Not to mention more taxes if you are buying and selling a lot. As an individual, I would probably just do discretionary stock picks and buy & hold fundamental analysis. After working at an HFT firm, I've more or less realized that institutional level trading (or things that try to emulate it at the retail level) are pretty difficult for little return. It would be a fun side project, but as a way of getting money, not so sure...
valdiorn
You're way, way better off finding a small outfit of motivated people to join if you want to work in this field.
Success rate for newly formed hedge funds is probably something like 50% over a 5 year horizon. For solo traders, it's probably closer to 1%.
There is WAY too much stuff you need to be on top of, if you want to be successful, than a single person can manage. It's about as feasible as starting a one man (coal) mining operation, where you must dig the tunnel, extract the coal, process it, sell it, manage the business operation and retain your sanity. You need at least a handful of people to be effective, all with different specialties.
...not to mention that if you're successful as a solo trader, you could be making 10x more with proper financial backing. If your strategy is returning 25% annually on a personal 1 mil investment, there's a good chance it'll still be returning >20% on a 10 mil investment (once you get to 100 mil or into the billions, your returns start to diminish due to market impact). Find a good backer, they'll literally give you money and a support team for a piece of the profit.
Shocka1
I've been attempting my own strategies for around four years now, after being inspired by a data mining Master's course I was taking. It has been a long and hard road for me, and I have mostly been trying to find correlations up into this year. As a one man show with a wife and kids, my project time starts at 10pm and sometimes goes until 3 to 4am. Then I wake up at 7 and take the kids to school and work my day job. I can usually do this two or three times a week, but lately I've been going to bed early as it's been wearing me out. I've had so many 4am nights that it's probably been a bit detrimental to my health at this point.
I'm not doing any order book or HFT stuff. It's mostly mean reversion < 15 minute trades. I have a considerable amount of options trading experience and that's what my main strategy revolves around. I don't have a killer strategy that some of these algorithmic firms are capable of, but the current one is promising. I also have a fairly rudimentary form of backtesting, which is a Jupyter Notebook crunching data I've collected over the years. I use some ML python libraries as a bonus, but I haven't created any strong enough attributes yet to achieve a high amount of predictive accuracy in that sense. My strategies mostly revolve around simple statistics.
My stack is a Linux VM with MySQL, running a suite of python scripts that collect data in real time and make the automated trades through TD Ameritrade's API.
By the way, I wouldn't consider myself smart or gifted - my strength relies solely on my determination. If you were to ask me if it's worth it, I would say "mostly." At the very least I've come away with a much higher understanding of the equity/option markets, and I know much more about MySQL, Python and data mining. At this point though I'd take a job with an algorithmic firm in a heartbeat.
pxmpxm
> Anyone here making real money from algo trading?
No, citadel securities just had a record year internalizing retail flow.
Kranar
I started off doing it on my own back in 2008 with nothing more than an Interactive Brokers account. Then I went all in and started a company to do it professionally around 2012.
As far as strategies go, I've said it here before, but all my strategies are quite simple and straight forward. The difficulty is almost always the execution. Almost all of my strategies are arbitrage or market making, and some of them trade off of events, like earnings, interest rate announcements, the weekly petroleum status report, and things you'd find on an economic calendar.
None of my strategies are speculative, that is I have no idea what company will perform well over a long period of time and in fact in many cases I don't even know what the company I'm trading even does. I also don't make use of any so called technical indicators, like relative strength, or fibonacci this/fibonacci that.
For the vast majority of my activity, my algos only enter into a trade if it's guaranteed to make money.
To give a vague idea of what the process looks like, every strategy starts from the premise that the market is perfectly efficient and there is no opportunity to make money. We then construct a model of what a perfectly efficient market should look like. We then backtest this model to determine whether the market is actually perfectly efficient. In most cases it will turn out to be either very close to efficient, or inefficient but in a way that cannot be profited from after taking into account fees, latency, and other factors. But sometimes you find areas where the model predicts certain behavior and the backtesting shows that the real world doesn't follow that model. In that case we then proceed to investigate very carefully what is going on. Did we make a faulty assumption? Is our model not seeing the whole picture so that there are factors we did not take into account? This happens A LOT and in fact we are very skeptical when our backtesting deviates from our model. But if after scrutiny we find no reason to doubt out model, then go from backtesting to running it in a simulator, and then from simulator to running it live on a very small scale, and then over time increasing the scale.
Our backtesting and simulating is incredibly sophisticated and precise. Almost all publicly available backtesters just look at trade activity or very low resolution data, and never accounts for things like market impact. Our backtester takes into account individual orders and simulates the entire order book, taking into account where our order would be placed within the order book. We also simulate potential market impact as well, which requires us to run simulations in parallel with different potential market impacts so we can see what the worst case scenarios are and there's a host of other factors a good simulator and backtester will take into account.
tdullien
As someone dabbling with the topic, I would love to chat with someone that made the step to run your own firm. Are there any good groups to meet others? Would you be up for a Videochat coffee?
Kranar
There are good groups but they tend to be people who are already deeply involved in the field. The vast majority of what you find, including discussions about this on HN, are complete trash to be quite blunt and it's very demoralizing.
LatteLazy
A colleague of mine does doing spread trading around commodities. He has 2 investors who put the money up, so I think you need a decent bit of leverage to actually cover fees and produce a return...
undefined
Lapsa
Managed to stay even for 3 months. Arcane stuff is what I got but I find it sensible.
codeisawesome
I always wonder if this space hasn’t been entirely cornered by HFTs. Isn’t it futile as an individual?
robswc
>Isn’t it futile as an individual?
HFT is, more or less... but algo trading in general can be as simple as executing strategies you would otherwise manually perform. I believe there's still enough alpha out there.
thkim
Algo trading != HFT. HFT is a type of algorithmic trading strategies, categorized by trading interval. In the same categorization there are mid-freq strategies as well. The term "high frequency" is rather subjective, it depends on what alpha you're targeting after.
ikrenji
HFTs is about using c++, putting your box as close to the market computer as possible and building out a private optical fiber from chicago to new york to lower your latency vs competition... algo trading can be anything from putting your personal strategy into code to using machine learning to discover trade signals etc
andreareina
HFT is mostly arbitrage, that's why they need the speed to reduce the risk. The rest of algo trading (and quant trading in general) tries to guess which way the market and individual securities will go based on market indicators and work over longer time horizons than HF traders work in. A simple example is that in low interest rate stocks will tend to outperform bonds, so the trade is to go long stocks and short bonds. Of course we expect that simple trades like this quickly be seen to be profitable and do more people do it and so the benefit of doing the trade versus just going long the market (beta) should eventually go down. So quants are always looking for other, more complicated trades as their current ones become less profitable.
tsss
HFT exploits very short lived movements. If you had some algorithm to predict long-term trends, then you could beat HFT without relying on low latency.
jjtheblunt
Is that essentially what Warren Buffett and Charlie Munger do?
HeyZuess
Buffet and Munger are value investors, there are multiple strategies in both investing and trading. Jim Simmons might be a more relevant example here in regards to trading if you are comparing the two.
hnthrowaway0315
Back in the day I was day trading a stock at a gig that provides high speed internet and professional trading software. Many of us did have medium to long term profitability, so I guess it's the same for algo trading.
paulpauper
Someone who merely bought and held tech stocks, like Apple & Nvidia, beat virtually all funds since 2009. There are always ways to make money even when your competitors have such advanced tools. The world of finance is big enough that there are opportunities for players of all sizes and resources. Look how badly AQR has done despite hiring from such a qualified talent pool.
TuringNYC
>> Someone who merely bought and held tech stocks, like Apple & Nvidia, beat virtually all funds since 2009.
This is both absolutely correct, and entirely in-actionable since it uses hindsight. The question would be...what are the two stocks to buy to beat the market for the next 13yrs.
ggm
Saturation of markets picked up pace across the 2nd half of the 20th century. Postwar, with transistors, electronic goods went to saturation over decades. Since mobile phones, a localized saturation can happen in 1-2 years. The rate Americans bought washing machines and microwaves changed to the rate americans bought iPods and phones. White goods manufacturers stopped looking like profit machines.
Apple has a huge problem now: it's eating it's own market. Believing there is an endless belt of profit owning Apple shares is to ignore the risks of consumers changing their minds about "I need this years iPhone" and sales tanking. I read more people saying "my iPhone 12/13 is still fine" than I read people saying "I want to spend $1500 on an iPhone 15"
The cost of being Apple never gets better. They now have exposure to costs they didn't have in 2009. They will have exposure to more costs (s/w complexity, VLSI in-house) and they will have exposure to more market entrants. They are also at risk of supply chain dynamics which could erode profits multi-year if bad enough: imagine if TSMC's yield drops on complex must-have chips? It's force majeure stuff.
I certainly wish I'd bought apple in the 2000s or before. I would hesitate to assume its worth owning FAANG stock now, rather than other things (including EFT)
The long-term rate of return on investment across markets is 6-7% and being above that for periods is unusual and begs questions.
paulpauper
It does not have to be as cherrypicked as individual stocks. Even something as broad as 'buying and holding an index fund' beats almost all funds and strategies. Doesn't quant funds also rely on hindsight? There are no guarantees that strategies will keep working.
Kranar
>Someone who merely bought and held tech stocks, like Apple & Nvidia, beat virtually all funds since 2009.
This is a common misconception or a poorly phrased statement. It's not true that someone who bought/held tech stocks, or an ETF beat virtually all managed funds or that holding on to ETFs beats virtually every managed fund. It's true that passive investing, in tech or ETFs would have beat the average managed fund, and it's also true that an investor is better off investing in an ETF/diversified portfolio, but there are exceptional managed funds that significantly outperform the market.
The problem is that you are no more likely to know which managed fund will outperform the market than you are to know which stock will outperform the market. Picking a fund that will outperform the market, especially after fees, is just as hard as picking stocks, and in fact it might be even harder due to the fees.
But this does not mean that all, or virtually all funds perform worse than the market or even a segment of it.
One of the advantages of hedge funds in particular is that they can employ leverage in a way that provides almost all of the upside of leverage while protecting an investor from some of the downside. For example if I, as an individual, used leverage to trade on the market and some black swan even happens, not only would I lose the amount I invested, I could also end up in debt and have to sell my house or other assets to cover my obligations.
If I use leverage through a hedge fund, then I still get almost all of the benefits if the market moves in my favor, but if the market moves heavily against me the most I can lose is my investment.
rustamm
Just because a managed fund outperformed a market doesn't mean it didn't happen by pure luck. There are lots of managed funds and most of them are not profitable. If each chooses portfolio randomly, some of them will outperform the market.
Panzer04
That largely depends on the type of leverage used (not all individual margin loans have the same conditions). It's possible to get pretty good terms as an individual in some circumstances (mostly if the loans are smaller and personally guaranteed), mostly by getting loans without margin calls attached. If you own a home, you can trivially borrow against it to invest without the risk of a margin call.
It's all tradeoffs - the broader the conditions at which a bank can recall your margin, the cheaper the interest and lower personal guarantee requirements (some may not hold you personally liable for negative balances - check your T&Cs). Funds can obviously borrow more, and at lower interest rates because of that though. Obviously their loans will be wound up on the way down no matter what, because the bank can't get money out of a negative balance like they would an individual.
Funds also don't tend to all-in on three tech stocks, so the fact they are very exposed to volatility with that type of leverage is less of an issue.
paulpauper
For example if I, as an individual, used leverage to trade on the market and some black swan even happens, not only would I lose the amount I invested, I could also end up in debt and have to sell my house or other assets to cover my obligations.
This is not true. The broker would try to liquidate your positions well before that happens. Failure to put up collateral means your position will be forcibly closed. It's called Maintenance Margin. The last thing the broker is going to allow is for its clients to incur a debt and be on the hook. The hedge fund instead will send you a letter that your money is gone. Same thing.
nemo44x
Monster Beverage has been the best stock of the last 20 years. Only idiots didn’t put their entire bankroll into it. Point is, you just can’t know.
Lapsa
For an individual - HFT isn't all that accessible. Fees gonna kill ya. But yeah - you just zoom out a little bit and work from there.
OJFord
Well, latency/capital required to lower it gonna kill ya too. Fees are an issue like the blinds in a pro poker game that you don't have the access to our buy-in for either.
boshalfoshal
fwiw, med/long term strategies are consideribly more difficult than HFT. Also, depending on the product (options, treasuries, etc.) most firms still have traders to manage strategies. For example, the top Options MM firms (CitSec, SIG, Jane Street, IMC, Optiver...) all have traders. Pure play algos is once again, consideribly harder (for certain products).
I still think theres alpha, but I don't think it would be from off the shelf methods that some random youtube trading guru talks about.
hm64
My favorite bit is when you connect it to core war. I was just thinking about core war in context of my PL class today. Core war renaissance!
TacticalCoder
> There is also a special order type called post-only. It is designed to only supply liquidity, never take liquidity. If the market moves between the decision to send out an order, and the order reaching the exchange, the order will not cross. Instead, it will be hidden, or cancelled. This makes it easier for algorithm designers to get the behavior they intend (that is, resting orders will not accidentally be converted into crossing orders).
I'd argue that an order that'd immediately be filled does provide liquidity to the market overall.
One reason to use "post-only" is explained in TFA:
> Many markets use the maker-taker fee structure. Traders that place orders that rest on the exchange earn a maker fee, and traders that “take” liquidity, that is execute orders against the existing resting orders, pay a taker fee. The taker fee is higher than the maker fee
If you do post-only, you'll get maker fees.
c54
You might have multiple strategies in the same symbol, one intended to send out post-only orders and one intended to send out crossing orders. Niche functionality like this can help achieve that separation of concerns.
Crossing orders are considered liquidity taking rather than providing since they're interacting with another market maker's resting (providing) orders.
TacticalCoder
> Crossing orders are considered liquidity taking rather than providing since they're interacting with another market maker's resting (providing) orders.
Ah that's interesting!
siftrics
> I'd argue that an order that'd immediately be filled does provide liquidity to the market overall.
No, it takes liquidity, by definition.
porb121
if someone bids 10000000 shares for mid, and I hit their bid, who provided the liquidity?
siftrics
You can argue about this philosophically, but if you talk to literally anyone in the industry, they will understand that
- "taking liquidity" is taking existing orders off the orderbook and
- "making [liquidity]" is opening new orders that rest on the orderbook
It's the terminology of the industry.
SamReidHughes
I would argue that it provides liquidity solely to whoever placed that resting order. But it takes it from the rest of the market.
kilotaras
> good example in the book explaining why a tick size is needed. > Say that the current bid in the market is $20. If you want to buy at that price, you will be placed last in the list of orders. But since the sorting order is first by price, then by arrival time, you could get first in line by putting in an order with a price only slightly better than $20 (say $20.00000001).
I don't buy the argument.
Removing tick (or at least reducing it 100x) would put more emphasis on price discovery instead of speed.
mistrial9
A colleague here tried to break into the trading world as an adult. He had a reference to be a member with a small cozy firm where his accounts could be held. He got "direct market access" (?) with a trading terminal that he said was good quality. Yet when I watched him work for several weeks each day, he was locked out of a SELL order more than once.. it didn't go through in any reasonable amount of time and he ended up losing some client's money and that was sort of the end. I don't know enough to know what happened, but it seemed like he was just pushed aside somehow, despite the cautious and reputable (?) parts he used. SF in the oughts iir
auntienomen
The article isn't about discretionary trading. It's about algorithmic trading, which is a bit like the word 'hacking' in that it means one thing to practitioners and another to the general public.
To practitioners it refers to the use of algorithms to trade large quantities of stocks or futures or whatever. The goal is to reduce trading costs by executing small trades at the right time. This is distinct from and rather more common than quant trading where an algorithm actually decides what bet to make.
nradov
Your story doesn't make any sense. Was this guy trading his own account, or was he employed as a proprietary trader, or was he running his own little investment fund using another company's platform? In any case, a legitimate trader won't be "locked out".
Are you perhaps referring to a locked market?
mistrial9
it was years ago.. the man decided on trades and executed them using a kind of terminal and base account that enabled that. Yet, "front running" is commonplace at all levels, in many forms. This man was a legitimate trader with credentials and ID, and when a SELL order was issued (get your money) the order did execute.. but how long did it take ? what prices changed while the order was being queued ?
nradov
That still doesn't make any sense. Do you mean he had passed the FINRA Series 7 Exam? Anyone with money can trade, with or without a Bloomberg terminal. Order execution speed will depend on the exact type of order the trader puts in and where he directs it; there are multiple types other than simple market sell orders and there are trade-offs between speed and price. And if he had evidence of his dealer engaging in illegal front running then he should have reported that to the regulators.
Anyway, it sounds like your colleague was just an idiot who didn't understand the basics of professional trading and got in over his head. He should have stuck with buying index funds on a Vanguard account.
matt3210
My algorithm worked great and I was in track to be a millionaire… in the bull market
kilgnad
How would I implement algorithmic trading at home? And would this be a viable idea if I knew what I was doing? Has anyone done this successfully?
dmurray
"Algorithmic trading" in the sense described in this article only makes sense if you have a customer who wants you to execute large trades and pay you a commission.
You can try some trading using algorithms to identify profitable trading opportunities. That would normally fall under "prop trading" instead. There are definitely people doing this in ways achievable by a home hobbyist, but don't expect any low hanging fruit. Find some niche in some less liquid instruments. Don't look for anything that relies on being fast - someone else will be there who measures latency in nanoseconds.
000ooo000
I spent a good few months building a system for fun/interest. Darwinex has an interesting business model - check it out - but it shows leaderboards of supposed profit-generating trading systems.
Thing is, one will be hard pressed to find solid, relevant, detailed and current information about legitimately profitable trading strategy. Once a strategy becomes widely used, the 'market inefficiencies' being exploited cease to be readily available, so there is a strong incentive to keep a good strategy private. I vaguely remember reading about HFT firms obscuring their trading activity for this reason. Additionally you will find the online world absolutely saturated with the grifter types. So good info is hard to come by. Be prepared to learn at least the fundamentals of both trading and statistics, do lots of testing, and basically figure it out on your own because nobody successful (and smart) is sharing their reliable, profitable strategies (that doesn't mean you can't learn from them - just don't copy paste).
It is a very interesting domain though and I thoroughly enjoyed learning about it all and building mine.
CTDOCodebases
This is what the average punter doesn’t understand.
You basically want alpha but alpha decays over time.
Think of alpha as being some insight no matter how slight that a coin will land heads as apposed to tails more times than not.
Now comibine this with a risk management system that involves you only risking 1% of capital (avoiding gamblers ruin) and you are off to the races.
robswc
>How would I implement algorithmic trading at home?
I made a python framework to try to help with this: https://github.com/robswc/stratis
However, it became hard to maintain an opensource version. I would say its still not a bad way to get a head start (bias there, ofc)
I will say, its not something that can be done "on the side." I originally made a decent amount of $ by getting lucky in crypto. I figured I'd "just become a algo trader" and it was much more difficult than I could have imagined.
I actually _just_ started a series on how to build an equity trading system from scratch. I planned to put part 1 out later this week but eh, I'll post it now, it touches on it better than my comment here can :)
https://robswc.substack.com/p/building-an-equity-trading-sys...
* the post assumes you already have alpha (a profitable strategy)
> Has anyone done this successfully?
Regarding this, I actually originally talked a bit with the (now infamous) SBF of FTX about this. I originally wanted to join Alameda Research... but at the time, I didn't want to move across the world. For years I regretted that decision (not so much now, lol) I started my own firm though and I have made a decent amount of $. Truth be told though, knowing what I know now, I might have put more energy into a start up. I enjoy the challenges of algotrading but doing some consulting work, I think I enjoy "building" more than running statistical tests, cleaning data, etc etc.
To sum up this comment though, _if_ you had a profitable strategy and _if_ you built a system that could reliably execute trades, you certainly could be successful. It is very difficult though.
downvoteme1
For starters, open a brokerage account at a broker that provides an API. There are many currently available including Ally, Tradier, Alpaca, Think or Swim, Interactive Brokers etc. Although, I think Think or Swim is currently not providing new keys due to their merger with Schwab.
Once you got that part setup, try to write a simple program that buys or sells an equity from the command line .
From their own you can start exploring trading algorithms. Some are pretty basic, like when the price crosses above a 200 DMA, then buy a stock as that usually signifies an upward run, while selling if the price falls below the 200DMA as that is bearish.
Then you can read some books on price action, fundamental or technical analysis and build your own algos.
wojciem
There are platforms like alpaca.markets that deal with all the infra-aspects and allow you to concentrate on the algorithm part.
Galanwe
There is litteraly 0 chance for you to be profitable in the medium to long term if you don't have years of experience in the industry.
Anyone claiming that is not the case is just misinterpreting his PnL.
The internet is full of people thinking they are market wizards just because they cannot residualize their idiosyncratic returns properly against beta, sector, country, size properly.
arminiusreturns
First, become a PDT (25k min to pattern day trade), meaning you can't execute more than 4 trades in a 5 business day time-period. So if you are serious, you have to get to that first... then realize that whatever broker you are using, they probably have an API.
I do raw api calls, but you have to be so very careful. You can do something wrong and totally, absolutely jack yourself up, so this way is only for the very brave, but I think it offers good opportunities to understand the markets better if you can stomach the extreme risk profile.
Check out https://algotrading101.com/learn/ for a good set of practical articles to give you some context. I wish I could still point to Quantopian, which is where I started my learning process on this, but it died.
ari_giblets
I'd like to know how an individual can do this, 1) And avoid some code bug causing them to lose all their money, and 2) Not get lose all their money to some company's API fees...
MonkeyClub
For (1), test profusely beforehand, and apply your algos in paper trades first (demo APIs without real market execution). And of course, hedge your bets, don't put all your cash on one algo/instrument in one go, and do at least some DD.
For (2), there are zero-fee brokers (e.g. those mentioned by downvoteme1 earlier) that you can use, so you don't have to keep feeding the broker.
robswc
> And avoid some code bug causing them to lose all their money
Well, everything has a non 0 chance but you can code certain conditions that have to be met before an order goes through.
IMO, you would have to have significant capital to even end up in a situation where a bug causes lots of loss.
Here is an example of something you might be thinking of.
https://www.henricodolfing.com/2019/06/project-failure-case-...
> Not get lose all their money to some company's API fees
It's not too bad these days. A lot of brokers offer "zero-fees" which really just means you only have to pay the SEC ones which aren't too bad.
taeric
I suspect the biggest catch for 1, is that you do it from an account where losing all of the money is an acceptable outcome. Clearly not the preferred outcome. But will not destroy you financially.
Which leads in to 2. The idea is that you are aiming for algorithms that take into account the API fees. If you didn't account for that in the price of business, than this is the same as not accounting for taxes in how you pay for things. That is, you did it wrong.
aryehof
Is it even possible to outperform the market in the long term, without some violation of the Efficient Market Hypothesis? Without insider knowledge/trading or some technical mechanism to access information or trades faster?
Get the top HN stories in your inbox every day.
The best book that I've read on order execution was "Algorithmic Trading and DMA". [0]
The book is kind of old now, but it was written by Barry Johnson, who worked at Morgan Stanley on their algo trading team.
The book is kind of dry, but very thorough and clear on its concepts. It reads more like a university text book than anything else. It just goes through concepts one by one, chapter by chapter.
[0]: https://www.amazon.co.uk/Algorithmic-Trading-DMA-introductio...