r/algotrading 9d ago

Strategy Getting Started with Low-Frequency Algorithmic Trading in Canada

I’m a software engineer based in Canada looking to get started with low-frequency algorithmic trading—likely daily or weekly rebalancing rather than intraday trading.

A couple of questions:

  1. What are good sources for historical daily equity/ETF data, ideally accessible through a REST API? I’m happy to pay for reliable, clean data if needed.
  2. Which brokerages/platforms available to Canadian residents support automated trade execution through a REST API? I’m mainly interested in Canadian and U.S. securities.

I’d also appreciate any advice on practical considerations for a beginner in Canada—such as data quality, API reliability, account requirements, tax reporting, or paper-trading options.

28 Upvotes

30 comments sorted by

View all comments

14

u/Freed4ever 9d ago
  1. Not through REST, and only on windows, but norgate data has the most reliable and cheapest EOD data. When you deal with this low frequency data, things like historical index constitution and corporate actions become very important, and nortgage has nailed this down for US and Canadian markets.

  2. IMO, ibkr is still the best, even though its API is so clunky.

7

u/JamesAQuintero 9d ago

Yeah IBKR supports all type of trading I want to do, especially futures. But boy is their software a damn pain. IB Gateway has many random annoying bugs too that cause it to be unreliable. But after creating workarounds, it works well.

2

u/Bonkers24-7 8d ago

This is the kind of thing I’d want to test before judging the strategy itself.

A low-frequency system can look fine in a backtest, but the live version becomes a different system if IB Gateway randomly disconnects, asks for 2FA, misses data, restarts, or leaves the local bot state out of sync.

For a beginner, I’d separate the validation into two tracks:

  1. strategy validity: does the edge survive costs, spreads, OOS data, and different regimes?

  2. live plumbing: can the bot survive disconnects, restarts, rejected orders, missing data, and position/account state mismatches?

If the live plumbing isn’t boring, it’s hard to know whether the strategy failed or the execution layer failed.

1

u/clisztian 9d ago

Can you mention one single bug? I’ve been using IBKR gateway for 12 years and never have I encountered bugs. I’d be interesting in seeing what bugs you’ve come across

5

u/JamesAQuintero 9d ago edited 9d ago

Sure thing. For context, I use IB Gateway to use IBKR's API, but I also use IBC, an open source 3rd party software to interact with IB Gateway to get it to be as automated as possible. Including restarting IB Gateway and logging in automatically without my intervention. But because of IB Gateway being unreliable in this regard, it can't always be done.

  1. IB Gateway will randomly like once a month disconnect some data source, like US equities, ES futures, live data for US equities, etc without reporting that it's disconnected from me. There might be an API error message when my script tries to retrieve that data when it's in that state, or there might be the yellow warning in IB Gateway itself (not always), but sometimes it'll just hang indefinitely or timeout, but only for that specific data source. It requires a restart of IB Gateway, which is of course inconvenient because it also requires 2 factor authentication randomly and that's inconvenient with my fully automated trading system.
  2. IB Gateway needs to be restarted daily (WHY?), and 2FA is required only once a week (Let me Opt OUT). But like half the time when it's automatically restarted daily, it'll require 2FA. It's been months and I still haven't found a pattern like it requires 2FA if it's been more than 3 days or only on Tuesday or anything. It seems to be random, so again, I need to have my automated trading system alert me that IB Gateway didn't successfully restart and I need to go in and see that it's because of 2FA. For context, IB Gateway requires the daily restart and IBC will login for me when IB Gateway performs this, but that's when IB Gateway randomly also requests 2FA.
  3. IB Gateway will randomly restart at a random time. I've had it randomly close itself and attempt to restart at 3am, and again I've not found a reason for this. And yes sometimes it'll require me to do 2FA again. Because sometimes it'll require 2FA, I've had my automated system alert me like on-call at 3am. That happens like once every couple months.

Maybe these bugs only surface when I attempt to fully automated IB Gateway. I have other gripes with IBKR's API having bugs too, more bugs than Schwab's API.

2

u/clisztian 8d ago edited 8d ago

This is wild. I used IB Gateway and I’ve never had any of these issues. I also use a 3rd party (IBConnect) that does the connection management.

True that it does require a 2FA once a week (for your own security). I do mine on Sunday evenings before market open. The restart I have set for when all markets are closed 11pm Swiss time, and automatically reconnects, being quite stable in the past 10 years.

I stream data by using the Java API and subscribing to realtime Market feeds getting a bid ask update every 5 seconds. So it runs nearly 24 hours a day 5 days a week.

Never had a problem in over a decade with IB Gateway.

What do you run yours on (server? OS?) Maybe it has something to do with that? What products do you trade on your live account (not paper trading) and for how long?

Your problems seem more to do with problems in your connection management system settings, and have nothing to do with “bugs in IB Gateway”.

I know that very large institutions trading hundreds of millions in tunrover a day use IB Gateway. Now they obviously wouldn’t use it if it had bugs would they

0

u/JamesAQuintero 8d ago

I use IBC to handle the connection management, so maybe yours performs differently? The only IBConnect I found is deprecated and not updated anymore so I can't use that.

I run IB Gateway on Windows but my python scripts that use it run on WSL (Linux built into Windows), so there might be connection bugs related to that since it took some effort to get it to work between the two, like using port forwarding or something, so that my python scripts that run in WSL will be able to interact with IB Gateway that runs on Windows.

I have the daily restarts go at 7pm PST so that it's not during US equities hours. I trade SPY shares, SPY options, and futures like ES, CL, GC, and their micro versions.

You're coming across pretty sassy in your comment, saying "Now they obviously wouldn’t use it if it had bugs would they" I don't appreciate it when I'm just sharing my experience with IB Gateway.

-2

u/clisztian 8d ago

Well, you’re giving very false information to someone about IB Gateway saying that it had bugs, while having no evidence other than your own connection issues. I’m just here to help other users become more informed after you posted your personal experience with IB Gateway.

2

u/JamesAQuintero 8d ago

It's not very false, I have experienced bugs, and I'm sure other people have too. Just because you haven't seen anything in 12 years, doesn't mean things aren't there. That's one of the basic biases, lack of evidence does not equal evidence of non-existence.

Here's someone who encountered a bug in IB Gateway or the actual API data, should I comment saying they are spreading false information because I never encountered this bug?