Bahman
Published on Apr 28, 2021
We started with “ Collecting Data ”.
We found out what OHLCV data is, and why we need both historical and online data.
Then we continued with “ Data Analysis ”.
We saw how important data cleaning and feature engineering are. To make a stable ML model, we must prepare the data correctly and visualize it to reach our goals.
Next, we explored finding a pattern and noted how easy it is to be “horoscopist-trapped” when searching for patterns—so we follow scientific methods like astronomers. We identified a simple pattern, “SMA20,” and discussed labeling it to [0,1].
Then we built a model. After building an ML model, you should evaluate it with a backtest. At this point, you need a Buy/Sell strategy—meaning we already have a signal to open a Long/Short position.
Now, it’s time to pass this signal to automation (a bot) that will buy/sell automatically.
The automation controls buys, sells, take-profits, and stop-losses based on model signals.
Before building a crypto bot, let’s review a few terms.
Cryptocurrency Exchange:
A cryptocurrency exchange (DCE) lets customers trade cryptocurrencies for other assets, such as fiat or other digital currencies. (Wikipedia)
For example, Binance is a popular exchange platform.
By registering with the following link, you may receive 10% back on commissions: Register on Binance
Spot Trading vs. Margin Trading:
In spot trading, you buy/sell the actual crypto/fiat pair (e.g., sell BTC to receive ETH or EUR). In margin trading, you take leveraged positions on price movements; your assets may be locked as collateral. Each exchange has its own rules and protocols for margin trading.
API connections:
Most exchanges provide secure API access, typically using two keys: Public Key and Secret Key. With these, you can place orders from outside the exchange.
What is a crypto bot or automation?
A crypto bot places orders on an exchange via secure APIs. Protocols vary across exchanges, and leverage (margin markets) adds complexity. Following our “start simple” approach, we begin with spot trading (moderate complexity). In the next season, we’ll implement a crypto bot.
Actions:
Our automation should support at least:
Now, let’s review the whole process from receiving a model signal to placing an order.
If you need more background on the model, see the previous episode on building a model.
Model output: Open a Long position on BTC/USDT
Conclusion:
Automation complexity depends on the exchange and its APIs. Prefer well-documented exchanges with solid support. There are libraries that unify connections to multiple exchanges. In the next season (automation development), we’ll cover how to use them.
Want a secure, comfortable way to connect your exchange to intelligent automation? Try 1DES.