This is an engine to facilitate copy-trading syndicated trades by other trusted traders over the internet.
Status: MVP Feature Complete, NOW IN TESTING
Core development is done and the system is working and a reference implementation paired with Impresario is available for the brave and bold.
- "Watch Account" mode for syndicating manual trades
- Test Ameritrade auth and trading (feature complete but currently untested!)
This application acts as both a WebSocket client and server on port 51585
.
Client authentication is performed using a 512-bit EC public/private key pair
that you must either generate yourself, or if you are subscribing to syndicated
trades of others, you must receive their public-key.pem
file and put it in the
project working directory.
Only nodes having the private-key.pem
file that pairs with the public key may
emit valid trade messages themselves, however every node in the network will
route trade messages to their immediate connections. Because of this, if you are
running your own trade syndication network, be very careful with whom you share
the private key (as in any case with cryptographic signing use cases), as anyone
with the file running this project will be able to dispatch trade signals to the
entire network.
Trade messages are themselves rudimentary, only describing the attributes of the trade itself: long or short, limit or stop-loss, symbol, type, and price information.
- You are 100% responsible for any trades made on your accounts, with or without this software.
- Pattern Day Trader violations: FINRA requires you to have at least $25,000 in an account in order to execute day trades. If the nodes issuing trade messages to your network are day trading and your account has less than the mandated minimum, your account could be suspended for 3 days. Repeated offenses could see your account suspended or closed, depending on your brokerage.
- There is no logic within this system for managing a position once opened.
- Once you are in a position, you either need to manage it yourself, or trust that the node that dispatched the trade message will accordingly follow-up with take-profit and stop-loss adjustments.
- For very large networks, slippage and missed trades (orders that are opened but never filled) are virtually guaranteed, especially for illiquid markets (symbols that have low trade volume).
- If you are joining a third-party network and not hosting your own, keep in mind that trusted nodes in the network are almost certainly front-running trades they share with the network, for their own personal gain.
These instructions could change depending on your operating system. The
following commands work if you have openssl
and ssh
installed:
openssl ecparam -genkey -name secp521r1 -noout -out private-key.pem
chmod 400 private-key.pem
ssh-keygen -f private-key.pem -e -m pem > public-key.pem
For Ameritade, please see the Ameritrade Instructions.
- Copy
example.client.config.json
toconfig.json
, fill in your API key and secret, and adjust settings as desired. Remove unused client configs if you don't have a brokerage account for that exchange. type
valid values arepaper
andlive
max_positions
valid values above 1, recommended values between 15 and 20leverage
valid values range between 0.5 and 2.0risk
is a percentage range between 0.01 and 1.00, recommended values between 3% and 10%shorting
should probably betrue
unless you are trading on a cash-only account, like an IRA
In all cases you should have make
/ build-essential installed.
- Redis running locally on port
6379
- Clojure 1.10+ and
rlwrap
Run make dev
to start
make docker/build-all
make docker/run-all
AGPLv3
-
Is this legal?
Probably, but if not someone should definitely take these guys down. In theory this is just as legal as following the trades of US Senators and buying bitcoin every time Elon Musk tweets about it.
-
Is this a good idea?
That depends entirely on whose trades you follow, and the general phase of the market at the time you start trading.
-
Will I lose money?
Almost certainly at times, but if you are following a profitable trader then by leveraging this or any software based approach for trade syndication, you will likely make just about as much money as they do.
Be aware that up to a 20% drawdown (from highest gain) in a year is pretty typical of most "safe" investment classes (e.g. Vanguard ETFs), but losing 90% on your account due to YOLO plays is ill advised.