Live data from Hacker News

Show HN: Trade stocks from the command line with no commission

gitlab.com

71–80 of 170 posts

Re: Show HN: Trade stocks from the command line with no commission

#71
post #64

Earlier quoted context omitted.

Common Lisp on SBCL. I lived on the JVM for quite some time (and still do), and I wanted to explore other ecosystems out of sheer curiosity. Got to playing with Lisp/SBCL, some initial tests showed it was pretty quick, and was impressed that I could disassemble functions in the REPL and iterate rapidly. Then a while later... I noticed there wasn't a FIX library at around the same time I was exploring creating my own…

Do you recommend that book and/or any others? Interested in automated trading + functional languages

I read it quite a while back, so memory is a little hazy.

It's one of the few books (perhaps the only one I've found) that approaches this subject matter from the perspective of an engineer wanting to architect their own system from the ground up, and potentially work for themselves or in a firm. But, going in, you should know that it focusses less on trading techniques and more on software architecture. What data structures you might use, and one potential approach that's laid out in the book.

Whilst some areas in the book are light (for example, the performance section), I'd recommend it if you're interested in ground-up building a trading system. If you work in the space already, you'll know the parts that are misaligned with majority of systems out there (choice of language being one). If you don't, and are looking to enter the space, it'll increase familiarity with core concepts (for instance, before I read this book, I had no distinction between "model" and "algo").

It's also refreshing that it stands out from the pack of books that aim to make you zillions of dollars just by using "these 10 key trading secrets!".

Re: Show HN: Trade stocks from the command line with no commission

#72

Earlier quoted context omitted.

Who is this question directed at? OP is linking free software. If you mean brokerages that advertise no fees to trade, they make money by loaning the cash in customers' accounts. https://www.bloomberg.com/news/articles/2019-10-10/brokers-p...

And by loaning out shares to short sellers [1] Which to me begs the question: do you actually own the shares when you buy them with those brokers? What happens if supply is limited and the loaned shares actually have to be sold? [1] https://www.investopedia.com/ask/answers/05/shortsalebenefit...

Ownership doesn't really matter that much so long as you meet the tax criteria for it. As for the rest, everyone else playing in this space is likely to have assets that are in the range of SIPC insurance so just make sure your stuff is insured and don't sweat the small stuff.

Re: Show HN: Trade stocks from the command line with no commission

#73
post #34

Alpaca is great! As far as brokerage APIs go, theirs is top notch and a breeze to code for. The founders are also really responsive and helpful. I know this because I wrote an app that connects to Alpaca accounts (as well as other brokerages) to help people build their own custom index funds [0]. It only took a few weeks to build our Alpaca integration, whereas other brokerages often take months/years just to get acc…

how does Alpaca make money?

Guesing, they are selling order flow. Same like Robin Hood

https://www.cnbc.com/2019/04/18/a-controversial-part-of-robi...

Re: Show HN: Trade stocks from the command line with no commission

#76
post #52

(Disclaimer that I'm working on an open source FIX engine in Lisp.) This is a really cool project! But alas I couldn't use it as I'm not in the US, and I don't trade with Alpaca. And I feel like this plays into a negative trend I'm seeing. The retail brokerage market right now is treading on similar 'mistakes' in institutional markets 15ish years ago. Proprietary APIs were prolific, and therefore increased switching…

Since you’re not from US, what trading platforms do you use? I haven’t found any with free commissions and public APIs in the EU. Well, except for Interactive Brokers.

You probably won't ever see an EU broker offer free trades. The EU market is more regulated to avoid anything that smells of front running. There was a somewhat revealing interview by the people behind Flatex, a big discount broker from Germany [0].

Dutch source, do use a translator https://www.tijd.be/markten-live/nieuws/algemeen/nieuwe-eige....

"Is it easier for a pan European company to keep big US competition like Robin Hood and Ameritrade out?

Niehage: 'The companies you name are very badly positioned for Europe. Their economic model is based on two pillars. Firstly, they want to offer everything for free. But if you offer all services for free, you have to earn money with the capital in the investors' accounts. That is possible in the US, where you can still get 2% of interest. In Europe, with zero interest rates, that's very different.'

And the second pillar of their economic model?

Niehage: 'That's the high frequency traders. As far as I know, Robin Hood sells its customer orders to this kind of parties. They are prepared to pay good money for that. According to the European MiFID II-regulation, that is illegal. Those two examples show that the US and EU markets are totally different. That's why American brokers have difficulties breaking into the EU market.' "

Re: Show HN: Trade stocks from the command line with no commission

#77

Earlier quoted context omitted.

And by loaning out shares to short sellers [1] Which to me begs the question: do you actually own the shares when you buy them with those brokers? What happens if supply is limited and the loaned shares actually have to be sold? [1] https://www.investopedia.com/ask/answers/05/shortsalebenefit...

Ownership doesn't really matter that much so long as you meet the tax criteria for it. As for the rest, everyone else playing in this space is likely to have assets that are in the range of SIPC insurance so just make sure your stuff is insured and don't sweat the small stuff.

One reason people invest in stocks at the moment is hedging against a falling dollar. In a great market turn, it could be that those $500,000 are the price for a cup of coffee. If you lose access to your shares at that moment, it doesn't help if you are rewarded with money.

*edit: Apart from that: is that actually an event covered by SIPC? Essentially it is a bad investment decision. You agreed to lend out those shares so you have to bear the consequences.

Re: Show HN: Trade stocks from the command line with no commission

#79
post #75

Does anyone know why they are US only? Is it because the market is different abroad, because there are no European/Worldwide legal framework or simply because it's easier to start with?

Looks like this is the answer:

https://news.ycombinator.com/item?id=23210385

Different market and laws.

Re: Show HN: Trade stocks from the command line with no commission

#80

Earlier quoted context omitted.

Of course, and in practice you basically always need to tweak your FIX layer when connecting to multiple brokers. Whilst there will be differences, you can rely on a surprising amount being uniform. The general session/authentication flow and serialisation mechanisms will be largely the same. Or the use of standard fields ClOrdID, or OrderQty. Or the "general" meaning of the messages NewOrderSingle or ExecutionReport…

Execution report is another thing that is different between the two. You can't even list your running orders without resorting to custom tags. You can't send multiple orders without providing their custom delimiters. You have to modify login messages and insert custom tags before a message is sent. The only uniformity I am left with is the fix template of key=value\0x01 repeating N times. Nobody conforms to fix 4.2 o…

I hear your pain... There's definitely brokers doing some strange things out there, or being overly sensitive to the order of fields. Let's not even talk about repeating groups.

> custom delimiters

Surely you mean custom _message_ delimiters, not field delimiters?

In any case I think it's a foolish endeavour to think that if a broker says "we conform to FIX4.4" to ever take that at face value. Agree that the conformance test always reveals the true extent of conformity.

But zooming out a little, despite these challenges, I'd say you're still in a better position than having N endpoints where 1 gives you a Java library with its own ridiculous threading model, another gives you a Python library that calls a HTTP endpoint (that you need to provide an OAuth token for), and yet another that only has a hosted C# interface. That's where we're headed towards.

Post reply on HN