I published a pre-alpha version of Barter, a trading system for setting up generic, automated (but not real-time), trades Right now, the system is built for dydx. The code is a work in progress - presently, only opening positions is supported and closing them is not (not a great way to profit :)).
Link to repo: https://github.com/aled1027/barter
Barter works in three steps:
Each day, data is synced from dydx for each instrument that’s registered in the database. In the future, any number of data sources can be supported, and in the current vision, they’d likely be supported by adding additional models for organizing the data.
After the sync finishes, a cron job executes a process that loops over the instruments and trade logic, identifying which logic passes. The trade logic queries the database as needed to pull in whatever data it needs. If a trade should be executed, it’s also executed in this step.
I’m interested in building a simulator feature where a user can put in criteria for a trade and see how it would have performed over time. This would be a great way to test out new trading strategies.