A command line tool for following US Senators trades using Alpaca written in rust.
Clone this repository to your local machine.
This program queries the data form Senate stock watcher and House stock watcher respectively. Using this data, it tries to place orders mimicing the trades placed by senate members/house members respectively.
It buys according to how the chamber members bought stock.
It sells according to how the chamber members sold stock (if there is something to sell).
Declare your API keys as follows:
export APCA_API_KEY_ID=YOUR_KEY_ID
export APCA_API_SECRET_KEY=YOUR_SECRET_KEY
export APCA_API_BASE_URL=https://api.alpaca.markets
For instructions on how to find these keys, refer to this guide.
Replicate US house member's trades:
rusty_trader -f order -c house
Replicate US house member's trades:
rusty_trader -f order -c senate
Show the performance of your portfolio:
rusty_trader -f alpaca_positions
If you need help, try rusty_trader -h
for usage information.
To automatically replicate the trades placed by US senators, you might create a crontab that looks something like the following:
APCA_API_KEY_ID=YOUR_KEY_ID
APCA_API_SECRET_KEY=YOUR_SECRET_KEY
APCA_API_BASE_URL=https://api.alpaca.markets
0 19 * * * ./Documents/CodingProjects/rust_trader/trader/target/debug/trader -f order -c house