Quick Start: Building a Trading Robot with TradeEngine's Code Editor
This guide will show you how to quickly create & deploy an algorithmic strategy using the code editor of TradeEngine. You will learn how to create a new strategy, choose the asset(s) you want to trade, backtest your strategy, and finally deploy it so it executes live trade. Of course, this guide assumes that you already have a TradeEngine account created - if this is not the case, you can create a free account here.
The first step is to create a new strategy. A strategy is basically all the things that are telling TradeEngine what to do in order to execute trades. There are two way to do that in TradeEngine: create a brand new strategy, or copy a strategy from our existing templates. We'll choose the latter option here, as it is the fastest way to create a strategy. For that, go to:
You should see the list of current available templates:
For this example, choose: "Simple Moving Averages Crossing" and copy it to your account. Then, go back to the Strategies tab, and you should see the newly copied strategy in your account. Next, click on backtesting to go to the backtesting panel.
You should now see the code for this strategy, as well as the interface to backtest your strategy.
The next step in running a strategy on TradeEngine is always to select the asset you want to trade. As you can see, in the strategy you copied the default instrument or asset is the LTCUSDT pair, which is a cryptocurrency pair. To change that, you can first check the list of all instruments by going to:
You should see the list of all instruments listed:
From there, you can search by instrument name, and also filter them by type (crypto, forex, or stocks). You can also click on an instrument to see more information about it, like it's historical prices.
For the rest of this guide we'll stick to the LTCUSDT pair, but feel free to experiment with other instruments.
The next step is to finally backtest our strategy! This is a very important step, as it will tell you how much you will have made (or lost) if you ran this strategy till now. This will also allow you to adjust your strategy and make sure it performs well on past data before actually loosing any real money by going live.
For that, go back to the strategy you created, inside the backtesting panel, and hit the "Run Backtest" button. This will start the backtesting with the current parameters defined in the code, and return the results when it is done. This is how it should look like:
Of course, numbers will be different for you as you run it at a different time. You can see that we got the plot of the value of our portfolio over time (here in USDT), and also some indicators about our strategy like the number of trades per year. Here, we made over 5k of profits over the 2 years of trading (backtests always start with 10k in the base currency).
I chose this example and parameters to illustrate this guide - but of course needless to say that things will not always go well. That's the step where you need to adjust parameters in your algorithm (here the short & long moving averages periods & types), or change your algorithm entirely. Even if you get profits like here, you can of course also adjust parameters to make more profits over time.
When you are happy with your strategy, it's finally time to go live! But first, if it is not done yet, we need to connect a live integration to your account so TradeEngine can automatically do trades for you. As we selected a cryptocurrency pair, we'll add a Binance integration as an example. For that, go to:
And click on "Add Integration". This will open a panel where you you can select the type of integration, and add all your API keys of the target platform. For Binance for example, you can find it using this guide: https://www.binance.com/en/support/faq/360002502072
We can now launch the strategy so it executes live trades. For that, go back to your list of strategies, and this time click on "Live Dashboard". You will your historical performance as well as the live trades executed by TradeEngine. When you are ready, simply click on "Activate Strategy", and you are done! You can now monitor what your strategy is doing right from this panel.
This is the end of this quick start guide that showed you how to run a strategy using code on TradeEngine. Now, don't hesitate to experiment, add more strategies, run more backtests, and deploy more live strategies! And of course don't hesitate to get in touch if you need any help!