Lurker News

Comments (166) 35 threads

Show all comments

Showing thread 1 of 35

srazzaque8 replies#
(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 costs and lock-in (looking at you, Reuters and Bloomberg).
On the one hand, retail brokers need to support popular programming languages and paradigms to gain traction. So, they are releasing http-based APIs, or popular language-specific libraries/bindings for their proprietary APIs. But, they are doing this instead of pushing well-publicised battle-tested standards such as FIX[1], that would normalise the playing field across brokers. So my gut feel is that they are banking on users coding against their APIs and having some lock-in effects. Notable exception is that any broker that supports cTrader will have a FIX API, because cTrader provides that for them.
The problem is: if I write a bunch of code to work against Alpaca, TD Ameritrade, or whoever, that code will likely need to be revisited for some other broker like Robinhood. Granted, market connectivity code _should_ be well abstracted from my model if I'm following good design principles. But at least with FIX, the core concepts, fields, and messages remain the same across most FIX endpoints (NOS, ExecRpt, etc), allowing for a more uniform code holistically.
[1] https://www.fixtrading.org

Random_ernest1 reply#
Probably not the question you had in mind, but what Lisp and what made you choose it?
srazzaque1 reply#
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 trading models.
So I can't say there was a lot of analysis across the different Lisps, etc. Had the coin flipped a little differently a while back this might have been in Racket. Also the choice of language in the book Professional Automated Trading[1] did influence me somewhat.
[1] https://www.wiley.com/en-us/Professional+Automated+Trading%3...

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

Continue this thread — 3 replies

klohto5 replies#
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.
hnarn#
Not sure about API but there’s Degiro.
nelaboras1 reply#
IB doesn't seem to be commission free though.
phyalow1 reply#
IBKR Lite is in the US, IBKR Pro in Aus etc is not.

Continue this thread — 1 reply

srazzaque2 replies#
I'm in Australia, so the choices here are also a bit limited. Also, I'm less interested in equities. In the CFD space, my shortlisting technique now is basically "do you offer cTrader", because as mentioned above, this means they have a FIX endpoint.

Broker offerings here seem a few "paradigm shifts" behind the US. Zero commissions are unheard of last I checked. Also, if you approach some brokers here and ask for an API or a FIX endpoint, you're either told to go away, or you're effectively ushered into a luxurious room, poured some exquisite scotch, and asked about how many millions of AUD you're looking to trade per month. And _then_ told to go away.
Edit: disambiguate "Aus" :-)

pedalpete1 reply#
Is IB "Interative Brokers"? I'm trying to figure out if Aus is Australia or Austria. I'm in Australia, and have been looking at who to go with. Almost signed up with CBA last week, but definitely more expensive to what I'm used to in North America.

Continue this thread — 1 reply

cturner#

    > Broker offerings here seem a few "paradigm shifts"
    > behind the US. Zero commissions are unheard of last
    > I checked.
A US-style zero-commission model is not viable in the Australian landscape. The root of this is due to regulatory differences, rather than actions by the brokers.

A key to understanding the US system is something called Regulation National Market System (RegNMS). Loosely, if you are filling an order for someone, it must be at a price that is at least as good as the best price available on any US market at that time. [Anecdotally, if the NYSE receives an order, and there is a better price available for the same stock on Nasdaq at the same time, NYSE can't fill it at their inferior price.]
This creates a hyper-competitive single market. At any one time, you can know the bid/ask spread for any stock, nationally. And, it's a tight spread.
Market makers compete here. But a market maker would prefer to interact with retail orders. Because what a typical retail participant cares about is getting an immediate execution at the best price currently in the market, in order to make a long-term investment.
So a market sprung up: market-makers pay brokers to send these benign orders to them directly, without going through the public market. The market maker fills these order at a price that satisfies RegNMS. [Some of them might even distinguish themselves by giving the consumer a better price than they would have got on the public market. Your broker might send you a report with your trade saying how much "price improvement" you got compared to what you would have got at the same time on the public market.]
The reason the trade is "zero commission" is because the market maker is paying your broker for the privilege of interacting with you directly, because you don't have a view on where the market is going to be in five seconds' time.
Australia has not developed anything equivalent to RegNMS. Without that, there is no foundation for the zero-commission trades (there is no national best price to protect consumers with). In Australia, the typical situation is retail orders being sent directly to the book on the ASX (a pseudo-monopoly exchange), where they are directly interacting with the most sophisticated houses.
If you google, you can find an ASIC paper trumpeting that Payment for Order Flow has been banned. In my view, the real story is a lack of innovation by Australia's regulators.

markvdb2 replies#
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.' "

Slartie1 reply#
And then fintech startups like Trade Republic or Just Trade came along and...offered basically free trades (the 1€ at TR can be considered almost non-existent when comparing to the 5-10€ even at discount brokers like Flatex).

They found a third way of financing themselves: just support one marketplace which kicks back some money to them on each trade, which they in turn earn from the spread between buy and sell prices.
I thought the US predecessors of this kind of broker (Robin Hood comes to my mind first) which is still pretty new in Europe would have basically the same business model - earning some money with each trade by scraping off a few cents (or a good bunch of cents for stocks with low liquidity) from the spread?

OJFord3 replies#
> You probably won't ever see an EU broker offer free trades.

Freetrade, Trading212, both registered in the UK. (And I don't think 'transition period' would make a difference, but they're both years older than that.)

Continue this thread — 3 replies

zelly4 replies#
The proprietary API is guaranteed to be slower. The brokers must send order flow as FIX to the exchange. This adds latency of however long it takes the broker's software to translate to FIX. I don't think there are any successful quant strategies that don't rely on speed, so basically anything with a proprietary API is solely for amateurs.
oarsinsync#
> I don't think there are any successful quant strategies that don't rely on speed

There are plenty of successful quantitative algorithms that are in use by non HFT firms
> so basically anything with a proprietary API
If you’re not a direct market participant, colocated in the exchange, you’re not in a position to be talking about speed at all. Also most exchanges optimising for speed are not using FIX.
> is solely for amateurs
You’re not necessarily an amateur, you’re just leaving money on the table for someone else as you’ve not optimised that area of your trading infra yet.

smabie#
I don't think you understand what quant finance is about. Almost all quant strategies don't rely on speed. In fact, HFT is usually considered a totally different space than investing (and therefore quant investing).
getlawgdon#
Actually the majority of quant trading isn't dependent on speed.
egwor#
> The proprietary API is guaranteed to be slower. Yeah, most of the time that's not the case. Binary encoding/decoding is often much faster than FIX. Look at ITCH/OUCH, SBE and FastFix.
nurettin2 replies#
FIX is just a protocol template. Vendors will make non-standard extensions to it. For example: OCO you send to CQG won't work with StoneX.
srazzaque2 replies#
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.
It's somewhat predictable where the differences are going to be: identifying securities (different codes, etc), expressing order types and algo parameters, and subtle differences to order lifecycles.
Again this is a gut feel, but I doubt that if you take 2 proprietary APIs, you'll get that level of uniformity.

nurettin4 replies#
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 or 5.0xxx they say they derive from it, then you go through their conformance test of 100 messages and see for yourself what changes they made.

Continue this thread — 4 replies

kasey_junk3 replies#
I have direct experience building the fix layers for integrating a variety of exchanges. I think FIX is a net negative. The standardization provides so little, there are so many murky edge cases in each implementation and the protocol encoding is so bad, I’d rather just program against the proprietary API. On the exchanges at least the binary APIs make so much more sense.

Continue this thread — 3 replies

peschu3 replies#
Is there a open source framework/application in go or rust based on FIX protocol? In forex quite a lot broker offer FIX apis(because MT4 is using FIX).

The use case would be to have only one application to watch/place orders simultanously on 2-3(...multiple) broker accounts. To spread risk of losing funds in case a broker goes bankrupt (or whatever reason).

Continue this thread — 3 replies

Continue this thread — 4 more replies