Add TickerAll (hosted MetaTrader 4/5) broker and feeds - #3
Draft
miguelangelo78 wants to merge 4 commits into
Draft
Add TickerAll (hosted MetaTrader 4/5) broker and feeds#3miguelangelo78 wants to merge 4 commits into
miguelangelo78 wants to merge 4 commits into
Conversation
miguelangelo78
force-pushed
the
feat/tickerall-metatrader-broker
branch
from
July 30, 2026 08:33
4e8cb2c to
c25cbfa
Compare
Contributor
|
Thanks for the PR!!Finalizing some refactoring. Will have a look at the PR once that is done. |
Adds a roboquant/tickerall module so roboquant can trade and stream market data from a MetaTrader broker account through the hosted TickerAll API, with no local MetaTrader terminal and from any operating system. - TickerAllBroker: account sync (cash, buying power, positions) + order placement (market/limit, modify, cancel), mirroring the Alpaca broker. - TickerAllLiveFeed: live bid/ask ticks published as Quotes over websocket. - TickerAllHistoricFeed: historic OHLC candles published as Bars. - Built on the official 'tickerall' Python SDK, added as a new optional 'tickerall' extra; no other new dependency. - Unit tests run in CI; live integration tests are credential-gated.
miguelangelo78
force-pushed
the
feat/tickerall-metatrader-broker
branch
from
August 8, 2026 11:56
c25cbfa to
15f2731
Compare
Contributor
|
I thought I left a comment before, but now I cannot find it :( So here again The overall project structure changed a bit after you created the PR, so I created new branch called tickerall that has for now the feed, broker and integration tests. Have been playing around with it (integration test) and 2 findings:
def __connect(self, client):
assert MT5_ACCOUNT and MT5_PASSWORD and MT5_SERVER
return client.sessions.start(
broker="mt5",
server=MT5_SERVER,
account=MT5_ACCOUNT,
password=MT5_PASSWORD
)
|
Expose the session-start step directly on the broker and feeds, so credentials go straight to a working broker without a separate client.sessions.start call. connect() uses keep_alive so a long-running session re-arms if the account goes cold, and close() ends only the session it opened; the existing account_id constructor is unchanged. Mirrors the roboquant-alpaca construct-from-credentials idiom.
Author
|
Thanks @jbaron, I've addressed your comment here: neurallayer/roboquant#104 (comment) |
…r-number account id The live IT suite required TICKERALL_ACCOUNT_ID to be the internal TickerAll account id, which is easy to confuse with the broker account NUMBER — a mix-up that only surfaced as a later "Broker account not found". The suite now derives the account id from a MetaTrader login (TICKERALL_SERVER/TICKERALL_ACCOUNT/TICKERALL_PASSWORD) when no pre-connected id is given, so it runs from broker credentials alone. Both the broker and feed constructors also reject an all-digits account_id up-front with a message pointing at connect().
_sync_orders built the size from a float, which LiveBroker wraps in Decimal(size), so 0.001 came back imprecise. Build it via str() like _sync_positions does. Adds a regression test.
miguelangelo78
force-pushed
the
feat/tickerall-metatrader-broker
branch
from
August 12, 2026 14:23
e534bd2 to
6bd4f0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
A
roboquant/tickerallmodule that lets roboquant trade and stream market data from a MetaTrader 4/5 broker account through the hosted TickerAll API. No local MetaTrader terminal, no Windows VM, no MetaTrader Python package, so it runs anywhere Python runs.It mirrors the existing
roboquant/alpacamodule:TickerAllBroker(aLiveBroker):sync()returns anAccount(cash, buying power, open positions), andplace_orders()handles new market/limit orders plus modify and cancel, following roboquant's id/size order model.TickerAllLiveFeed(aLiveFeed): live bid/ask ticks published asQuoteitems over a websocket.TickerAllHistoricFeed(anInMemoryFeed): historic OHLC candles published asBaritems for backtesting.It is built on the official
tickerallPython SDK, added as a new optionaltickerallextra. No other new dependency.This is the Python counterpart of the Kotlin integration discussed in neurallayer/roboquant#104.
Testing it yourself with a free account
You can run the whole integration suite yourself at no cost:
tests/unit/test_tickerall_it.pyexercises every surface against the live demo: account sync, historic candles, live ticks, and a demo-guarded round-trip that places and closes a market order and places, modifies, then cancels a pending order. It refuses to run against a non-demo account, and it is gated on the two env vars so it skips cleanly in CI without secrets.tests/unit/test_tickerall.pyis a set of unit tests that need no credentials at all.A note on cost, so there are no surprises
There is no free lunch on live trading: connecting a real-money broker account is a paid tier. But demo connections, historic candles, and the whole integration suite above are free, so testing, backtesting, and paper-style trading against a demo cost nothing.
Opening as a draft so the shape and the test approach can be reviewed before this is a formal review request.