Visual Editor Guide
Last updated
Last updated
We start by clicking on the new script icon in the toolbar.
A popup will appear asking us for a few details. Give the script a name and description. In the Type dropdown select Trade Bot Script. This script has a few commands by default we are going to use in our trade bot.
Once the script is created and loaded the following script will show. It has 4 command by default. A SafetyContainer, IndicatorContainer & InsuranceContainer. All connected to the TradeBotContainer. The SafetyContainer will be the endpoint for all our safeties, the IndicatorContainer for our indicator and the InsuranceContainers for our insurances. Learn more about the Trade Bot system here:
Visual Editor GuideWe start by adding some indicators to our script. We will use the EasyMa and EasyRSI. To learn more about the Easy Indictors click on the link below. Right click on the dot next to signals[] on the IndicatorContainer. A menu will appear with several suggestions. Every in and output has a suggestion list. This will help us create a script super fast. Select the EasyMa and EasyRSI in the list
Visual Editor GuideBoth command have 3 inputs. A chartIndex, name & interval. The chart index for the plot. We want the MA to be drawn on top of our candles and the RSI below it. Set chartIndex the MA on 0 and the RSI on 1. We can leave the name field empty. It is only required when we use the same easy command twice in order to have unique input field names.
We want the RSI to work on 20 minutes and the MA to work on 60 so we do want to attach something to the interval. Right click on the dot next to it and select InputInterval. This will create an interval dropdown in the settings and allows for different intervals for each indicator. Give them both a unique name and give the MA one a default value of 60 and the RSI one a default value of 20. This is the last step for our indicators.
Each script needs a safety. We are going to add a StopLoss to ours. Again, right-click on the dot next to signals[] of SignalContainer. Select StopLoss from the list. Move the blocks so it doesn't overlap with the EasyMA. The StopLoss requires 3 parameters of which 2 are optional. First, we have the percentage. This is the Stop Loss % value. Right-click on the dot and select Input. Give it a name related to the StopLoss and a default value of for example 5. The other 2, postitionId and direction are for more advanced usages and we don't care about that in our script. We can leave them open.
Next, are the insurances. We move over and again, right-click on the dot next to signals[] of InsuranceContainer. In the context menu, we select OverComeFeeCosts. This will make sure when we place a sell order, we at least cover the fee costs. The OverComeFeeCosts has 2 optional parameters. Both are for more advanced usage and again we don't care about that in our script.
We have added every element we needed for our script. The last step is to save the script. Once the script has been saved and there are no errors, we will find all our input in the left menu. If we run a quick test we can have a look at the chart. First, click on the play and then on the chart button. Wait for the backtest to be finished and a chart will show up. We will find our EasyMA on the price chart and the EasyRSI below it. On top of the chart, we see green and red bars which show us the buy and sell signals. On the lower side of the price chart, we see red horizontal lines. Those are drawn by our StopLoss command and show their trigger price.
We have now finished our script and can start backtesting it with the backtest remote on the top right or create a new bot with the script and start trading.