Trading Engine Tutorial. In this tutorial we will be demonstrating how to use the Trading Engine to design your own Trading Bot. We will also analyze the process, the costs and guide you through the process.
Step 1
You will need an account in Trading View. Register for an account here. If you plan to use the Trading Engine to automate trades in your exchange account, then you will need to go for the Essential Plan for 14.95$ per month. It will allow you to set up at least 20 Bots since the Strategy Alerts in the Trading Engine count as one alert per chart.
Once you subscribe, go to the upright side of the screen, and copy your username.
Step 2
Go here and select one of our subscription packages. If you go for the annual package the monthly cost will be 28 USDT per month. Remember that you have to have a Metamask wallet with USDT (BEP-20 Tokens) to be able to pay at the check out.
Please paste your Trading View Username in the Additional Information field.
Step 3
Once you receive an e mail from us that your order has been completed, go to your Trading View Chart, select Indicators at the Heade, then Invite-only scripts and you will find the VFLOW Trading Engine with a green lock sign. Click on it to add it to your chart and add it to your favorite indicators by clicking on the star.
Step 4
Now let’s explore the inputs.
Show Moving Average Waves
The Smart Moving Average is enabled by default. The Line changes color according to a set of parameters. You can select to plot as many as 20 lines but we strongly recommend to use the basic setting.
Show Price Channel
Select it to draw price channels. Select the chart option in resolution.
Auto-Fib
Use this to adjust the automated Fibonacci retracement tool. Untick it to see it on the chart.
Date & Time Filters
With this feature you exclude the strategy from working. You turn off the strategy for selected time periods. This is ideal for testing but also for FOREX Traders so they can program the strategy to be active during specific time windows. Use the Trading Session Filter for this functionality.
Trade Direction
Trade Direction: Choose among Both (meaning long and short ideal for futures trading), Long Only (ideal for spot trading) and Short Only (ideal only for futures trading during bear markets).
Use SL/TP Type: This is our stop loss and take profit setting. In Regular mode you set the limits in the Regular- Stop Loss and Regular – Take Profit fields. In TrailATR you adjust the Trailing- Deviation, Trailing H/L Lookback and the Trailing – ATR Lookback. In TrailPer you set the Regular Stop Loss and Take Profit and you set the Trailing Take Profit Percentage. When the price goes above your Regular Take Profit the trade remains open and will only close when the price reaches a high and then retraces by the Trailing Take Profit Percentage. This is ideal for small time frames.
Stop Short – Open Long
Select these options for programming trades where a short position closes, and a long position opens. These settings work as short positions stop loss or take profit points and also as long position opening points. Use the Strategy Tester to see the outcome of your selections.
Stop Short & Stop Long
Stop Long: 9 options to set stop loss or take profit points for long trades. These options do not trigger short positions.
Stop Short: 7 options to set stop loss or take profit points for short trades. These options do not trigger long positions.
Stop Long – Open Short
Select these options for programming trades where a long position closes, and a short position opens. These settings work as long positions stop loss or take profit points and as short position opening points. Use the Strategy Tester to see the outcome of your selections.
Timeframe Sensitivity and Signal Sensitivity
Timeframe Sensitivity: We suggest keeping the default settings. For smaller time frames input smaller values and for bigger time frames input higher values.
Signal Sensitivity: We do not suggest changing any of these settings apart from setting 8.
AI Lines
To enable the AI Lines click the Enable AI Lines box. You can adjust the AI Lines Calculation Factor as well as the Line Length, Width and Color.
Smart Filter and Microzones
Now you can split your Chart into Long Only Trade Zones and Short Only Trade Zones.
The Long Zone has a Green Background. When the price enters the Green Zone any Short Trades are automatically closed. In a Long Zone only Long Trades are allowed and Short Trades are ignored. If your select the Microzones functionality then within the Long Zone any Short Trade will act as a stop loss for Long Trades.
The Short Zone has a Red Background. When the price enters the Red Zone any Long Trades are automatically closed. In a Short Zone only Short Trades are allowed and Long Trades are ignored. If your select the Microzones functionality then within the Short Zone any Long Trade will act as a stop loss for Short Trades.
You can adjust the width of the Smart Filter Zones by adjusting the Higher Time Frame. By this way you can either use the chart timeframe, a higher timeframe or even a smaller timeframe.
This technology will protect you from trend reversals especially in small timeframes.
Alerts General Settings
This is the part of the settings where you decide where to connect the Trading Engine to. The options are:
Binance: Direct connection with Binance with the use of the Binance Webhook Functionality. Access the Binance Tutorial here.
Bybit: Direct Connection with Bybit with the use of the Bybit Webhook Functionality. Access the Bybit Tutorial here.
3Commas Single Bot: Connect the Trading Engine with 3Commas for a set of Single Bots (Long, Short).
3Commas Multi Bot: Connect the Trading Engine with 3Commas for a set of Multi Bots (Long, Short).
OKX: Connect the Trading Engine directly with your OKX Exchange Account.
Code Boxes: Copy and Paste code for connecting 3Commas or MT4-MT5 with the use of Pine Connector.
Step 5
It is important to back test your strategy. So first select the crypto and time frame you will be experimenting on and go to the bottom of the chart and open the Strategy Tester.
In this case we designed a strategy on the Ethereum/USDT pair on the 5 Hour Chart. Our settings are:
Regular Take Profit: 15
Regular Stop Loss: 1.7
Stop Short – Open Long: 5, 9, 10, 11, 15
Stop Long: 3
Stop Short: 1
Stop Long – Open Short: 3, 4, 11, 13
We kept the rest of the parameters as they were.
We got an exceptionally good result as for 1255% ROI with 25.9% drawdown.
Step 6
Calculating the ROI and drawdown
Now this is the most important part of our tutorial. Use this section to calculate your risk ratio and your capital formula. In this case with an initial capital of 10000 USDT, we opened positions with 15000 USDT. To do this we will use an X4 leverage in cross mode so the actual capital we will be using is 3750. In all our testing period the worst drawdown was 7809 USDT. Now this means that if we entered that specific all time high point to be able to open positions of the same size, we would have to allocate almost 7900 USDT to the Bot.
Make adjustments do not be greedy
In our case we always use 3750 USDT for the Bot so there are 6250 USDT to cover the losses. This is a worst-case scenario. If we want to be 100% covered then we would have to lower our order size, for example to 12000. In this case the drawdown is reduced to 6247 USDT and we are fully covered. So, in this case we can let the Bot do its work and, in the end, we will see a 1004% ROI in a seven-year period.
The basic formula
Of course, all of this is hypothetical and there is always risk in automated trading. A basic formula is to use 50% of your balance with leverage X2 and leave the other 50% to cover for the drawdown. Of course, this is not investment advice but just a math exercise. Now if we have our strategy set let’s go to 3 Commas and set our Bots.
Step 7
3Commas offers 3 subscription levels. You will need at least two DCA Bots so you must go for the Pro Subscription. Open an account in 3Commas here.
Step 8
It is important to use the 3Commas Fast Connect bridge to connect to your exchange account. They use secure restricted ip addresses and your exchange account will work smoothly with the Trading Engine in Trading View. Go to my portfolio, then on the upper-right section select connect account and finally select your exchange. Do not forget to select Futures as the category. Follow the instructions and connect your exchange.
Step 9
On the main page, select the Create DCA Bot option.
On the DCA Bot page follow these instructions:
- On the Exchange Tab be sure to select the USDT-M Account.
- Bot Type: Single Pair.
- Pairs: In our case ETH/USDT.
- Strategy: Long for the 1st Bot and Short for the 2nd when you repeat the process.
- Profit Currency: USDT.
- Base Order Price: In our example it is 12000.
- Start Order type: Limit.
- Leverage Type: Set it to cross.
- Deal Start Condition: Trading View Custom Signal
- Take Profit: Select Conditions and then Trading View Custom Signals
- Stop Loss: Turn it off.
- Safety Orders: Max Safety Orders Count set it to zero.
Step 10
Now in the next page after you launch the Bot you must copy paste these parameters into a word doc or directly into the Trading Engine:
For a Single Bot Pair (your Bot will be for one pair ex BTCUSDT)
For Long Bot: Bot ID, Email Token.
For Short Bot: Bot ID, Email Token (it is the same with the Long Bot).
Now copy and paste these parameters here:
Do not change the delay settings or copy and paste any info into the Trading Pair box.
Step 11
Now if you want to set up a MultiBot then you must copy paste these parameters into a word doc or directly into the Trading Engine:
For Long Bot: Bot ID, Email Token.
For Short Bot: Bot ID, Email Token (it is the same with the Long Bot).
Trading Pair: Add the Trading Pair as 3Commas expects for example for BTCUSDT the code is USDT_BTCUSDT
Now copy and paste these parameters here:
Do not change the delay settings. Change the trading pair according to the chart you set the alert in. Example for an Ethereum Chart use USDT_ETHUSDT or for FTM use USDT_FTMUSDT.
Step 12
Now on the chart right click on any of the strategy labels or lines and in the pop-up window select add alert option.
Select the order fills only and at the expiration option select Open Ended alert. Rename the alert so you can easily search for it.
Erase the default message in the message filed and paste: {{strategy.order.alert_message}}
Then go to notifications.
Tick the Webhook url paste this: https://app.3commas.io/trade_signal/trading_view
Also tick the Notify in app option and Show pop-up option. We do not recommend selecting send mail or play sound.
You are all set.
Final Thoughts
Using the Trading Engine, the Trading View Platform and the 3Commas platform is going to cost you around 95 USDT per month. But you will be able to set up your own Bots and offer your own copy trading services. You will not have to pay success fees and you can even set up your own trading signals channel. If you have a good strategy, contact us to become a Bots Strategist. Join our Discord channel to ask us for our proposed settings for several cryptocurrencies. Thank you for reading this tutorial.
How to connect the Trading Engine to OKX Signal Bot Platform
Step 1
The initial step of course will be to open an account at OKX. If you do not have an account open one here.
Watch our tutorial on how to open an account at OKX and top it up with USDT here.
Step 2
Use our Trading Engine OKX Version to set up your strategy and back test it. (Step 3 to Step 5)
Beware to find and use the OKX Perpetual Swap Trading Pairs in Trading View.
The new feature you will see in the OKX Version of the Trading Engine is this dashboard:
Order Type: Select among market and limit (we suggest market)
Investment Type: Choose among margin, contract, percentage_balance (percentage of your current balance-good for reinvesting your profits), percentage_investment (remains steady it is the percentage of your initial margin placed when you start the bot). We suggest to use percentage_investment
Amount: It is in percentage form. If you type in 100 it will use 100% of the balance in your Bot Wallet. Do not type a number above 100 if you want to use leverage you will do that at OKX.
Step 3
Now it is time to create your Bot.
Go to Trade, then Trading Bots and then Marketplace.
Click on the Signal Bot create button.
Select the add custom signal button.
Give a name to your signal for example BTC Bot and add a description for your strategy if you wish. Then click on the Create signal button.
Copy and paste into a word doc:
- The webhook for sending the signal to OKX: https://www.okx.com/algo/signal/trigger
- The Signal Token without the “”. Start from the first letter till == in the end.
Step 4
Go back to Trading View.
Paste the Signal Token into the box and then click the blue ok button at the bottom.
Then follow step 13 and make sure you paste the OKX webhook url before you create the alert.
Follow the instructions and then click save.
Step 5
Now go back to OKX.
Find the Signal you created and click on create Bot.
1: Select the Trading Pairs you have included in your strategy in Trading View.
2: Set the leverage. Your position will be the percentage amount you selected in Trading View ex 100 for 100% X the leverage you choose here.
3: Use the slider to allocate funds to the bot.
4: Click on create.
At the final step you will be transferred to the Bots Page where you will be able to monitor its performance.
How to connect the Trading Engine to MT4 and MT5
You can use the Trading Engine for FOREX. This can be done by connecting your MT4 or MT5 to Trading View through the use of Pine Connector.
Step 1
Click here to go to Pine Connector Site. You can start with the Free Trial. Then the license costs 24.9 USD.
Step 2
Next step will be to connect Pine Connector with MT4/MT5.
In order to do it read the instructions here and watch this video here.
Step 3
Now next step is to structure your alerts. You can see details about the syntax here.
Examples for XAU:
Open Long: (Your Pine Connector License ID),buy,XAUUSD,risk=0.01
Stop Long: (Your Pine Connector License ID),closelong,XAUUSD,risk=0.01
Open Short: (Your Pine Connector License ID),sell,XAUUSD,risk=0.01
Stop Short: (Your Pine Connector License ID),closeshort,XAUUSD,risk=0.01
Examples for FTMO for ETH (use the custom FTMO ETH Bot Settings for alerts and CAPITALCOM Charts):
Open Long: (Your Pine Connector License ID),buy,ETHUSD,risk=30
Stop Long: (Your Pine Connector License ID),closelong,ETHUSD,risk=30
Open Short: (Your Pine Connector License ID),sell,ETHUSD,risk=30
Stop Short: (Your Pine Connector License ID),closeshort,ETHUSD,risk=30
Examples for Crypto Fund Trader for ETH (use the OKX ETH Bot Settings for alerts):
Open Long: (Your Pine Connector License ID),buy,ETHUSDTf.t,risk=30
Stop Long: (Your Pine Connector License ID),closelong,ETHUSDTf.t,risk=30
Open Short: (Your Pine Connector License ID),sell,ETHUSDTf.t,risk=30
Stop Short: (Your Pine Connector License ID),closeshort,ETHUSDTf.t,risk=30
Step 4
Now paste your alerts into the 3Commas Boxes in the Trading Engine.
Paste your buy command in: Open Long
Paste your sell command in: Open Short
Paste your close long command in: Long Reversal, Long TP, Long SL, Long Trail
Paste your close short command in: Short Reversal, Short TP, Short SL, Short Trail
Then set an alert and use the Pine Connector Webhook: https://webhook.pineconnector.com/