*** WORK IN PROGRESS***
The ultimate goal of this topic is to create an autonomous trading agent workflow.
The idea is that this agent will be able to automatically place buy or sell orders, within certain configurable limits, when certain conditions are met. We have already built a node which can place orders on this page .
As a next step, I want to create a Workflow that will get the Ticker values (in this example from Revolut) and write them to our database, so that later on we can track their evolution. We will schedule this workflow to execute every hour using the technique I described earlier here
Below a screenshot of some of the tickers that got loaded in my database.
We can now start to use this data to track their value change over time, for example here we see today's BTC-USD price evolution. Of course, this will get more 'interesting' as time goes by and we have more data loaded.
In the next part we will start developing agents that will execute certain actions (buy, sell) if certain trigger values are met.
Below is the first attempt at a workflow which does so.
What it roughly does is to select the latest market value (the highest timestamp) of a certain trading pair (BTC - USD in the example) and compares this value to the previous day's value (through the Date Shifter and Joiner nodes). Then, it checks if a certain condition is met (in the example, value decreased more than 1 percent) and according to this, branches to one branch or another of the Workflow (If Switch and previous nodes).
In the example, both branches are DB writer nodes to different data base tables (I used this for debugging), but in practice one of the branches could be the Python script node to place a selling order we saw previously.
BTW, I am not suggesting I would sell my BTC if there was a price drop of 1%, this is just an example.
This is a version 1.0, lots of improvements could be made, for example parameterizing the trading pairs and thresholds to trigger actions. But basically, this works. The idea would be to schedule this workflow on a daily basis, for example.
Any comments, suggestions, etc are welcome as always.