About the Deriv Bot category

Automated trading. No coding needed.

Feel free to provide feedback on topics you feel more information is needed for us to update them from time to time accordingly.

From,
Team Deriv

My concern is not abojt Dbot but rather Binary Bot Platform, i do not know causes the bot to freeze after couple of trades maybe 5 trades or the trade does not settle the while the bot is running, please help, what should I do when this happens?

What is technical analysis?

Technical analysis is a trading discipline employed to evaluate investments and identify trading opportunities by analyzing statistical trends gathered from trading activity, such as price movement and volume.

The key concept in trading analysis is a trend identification. It’s done by analyzing charts and finding patterns in the past price changes.

Ticks and candles

Since technical analysis focuses on analyzing charts and price changes over time, it’s worth mentioning ticks and candles as those are key concepts in charting.

Tick is a price of underlying asset at a specific moment of time. Prices change every 1-2 seconds on Binary and Deriv platforms (on MT5 and Deriv X prices can change more frequently for Forex pairs).

Candle is a representation of a time period such as 1 minute, 2 minutes, 5 minutes, etc.

Both ticks and candles can displayed on charts.

Ticks charts are mostly useful for short-term strategies whereas candle charts fit better for longer term analysis.

Tick chart shows every single price change whereas candle chart summarized price changes for a specific time interval and displays it as candles. The horizontal axis is the timeline and the vertical axis displays prices of the underlying asset.

Tcik chart

Candle chart

Each bar on the candle chart is called a candle and it represents a time interval, for example 1 minute, or 15 minutes, or 1 hour, etc.

Each bar has 4 important properties: open price and close price are the first and the last price of the candle time interval.

High and low prices are the highest and the lowest prices of the underlying asset during the candle time interval.

Trading platforms can color candles differently. Deriv.com and Binary.com platforms show Red candles when open price is greater than the close price, and Green candles indicate that open price is less than the close price.


Blocks to work with ticks and candles

Indicators

What are indicators and how to use them?

  • Technical indicators are heuristic or mathematical calculations based on the price, volume, or open interest of a security or contract used by traders who follow technical analysis.
  • Technical analysts or chartists look for technical indicators in historical asset price data to judge entry and exit points for trades.

Source: Investopedia

In Binary Bot and DBot technical indicators are blocks that require a list of prices as an input parameter and return signals that can be interpreted by a trader to make a decision to enter or exit the market.

Simple Moving Average (SMA)

SMA is a frequently used indicator in technical analysis. It calculates the average market price over a specified period, and is usually used to identify market trend direction: up or down. For example, if the SMA is moving upwards, it means the market trend is up. Simple Moving Average (SMA) Definition

image image

Exponential Moving Average (EMA)

EMA is a type of moving average that places more significance on the most recent data points. It’s also known as the exponentially weighted moving average. EMA is different from SMA in that it reacts more significantly to recent price changes. Exponential Moving Average (EMA) Definition

image image

Bollinger bands (BB)

BB is a technical analysis indicator that’s commonly used by traders. The idea behind BB is that the market price stays within the upper and lower bands for 95% of the time. The bands are the standard deviations of the simple moving average. If the price reaches either the upper or lower band, there’s a possibility of a trend reversal. Bollinger Band® Definition (Technical Analysis)

image image

Relative strength index (RSI)

RSI is a technical analysis tool that helps you identify the market trend. It will give you a value from 0 to 100. An RSI value of 70 and above means that the asset is overbought and the current trend may reverse, while a value of 30 and below means that the asset is oversold. Overbought or Oversold? Use the Relative Strength Index

image image

Moving average convergence divergence (MACD)

Moving average convergence divergence (MACD) is calculated by subtracting the long-term Exponential Moving Average or EMA (26 periods) from the short-term EMA (12 periods). If the short-term EMA is greater or lower than the long-term EMA then there’s a possibility of a trend reversal. Moving Average Convergence Divergence (MACD) Definition

image image

Every strategy created with Binary Bot or DBot consists of 6 steps as shown on the diagram below. First two steps are executed only once, when a strategy starts. The following 4 steps repeat indefinitely unless user stops the strategy manually or by adding a condition to the last step. The 5th step (Sell a contract) is optional and can be removed from a strategy. If the 5th block is on the workspace, when strategy is running it keeps executing the content of the on every tick.

Steps 1, 2, and 3 are represented by the first main block.
Trade parameters is a mandatory block. Every bot will have one trade parameter block by default and you cannot add more than one trade parameter block in one bot.

Trade parameter block is responsible for the first 3 steps in the control flow:

  1. Selecting the market
  2. Assigning initial values to variables
  3. Setting stake, duration, barriers, and digit prediction (depending on the contract type you select)

Step 1: Trade parameters | Define you trade contract

Market & Trade Type
You can select your desired market, and asset type, and trade type you want to trade in here.

Contract Type
You can choose what type of contract you want to trade. For example, for the Rise/Fall trade type you can choose one of three options: Rise, Fall, or Both. If you select Rise, you won’t be able to purchase Fall in the Purchase condition block.

Default Candle Interval
This allows you to set a default time interval for blocks that read lists of candles. This is important when working with technical indicators. We’re going to cover it in the lesson about technical analysis.

Restart buy/sell on error
This block restarts the bot automatically when an error is encountered. Sometimes internet connection breaks up and the purchasing or selling contracts is unsuccessful. In this case your strategy can either start over or keep on executing. By default it is unselected for better performance.

Restart last trade on error
This block allows you to have an option to repeat the previous trade if an error is encountered during the trade. This complements the previous block. You can choose to keep trying to purchase a contract in case of an error. You can activate or deactivate as required.

Step 2: Run once at start

Almost every strategy needs to assign some initial values to variables. You can add logical blocks here as well to perform tasks which you want to run just once when your strategy starts running.

Step 3: Trade options | Define trade options

In this block you define your desired duration, stake, predictions, and barriers depending on the contract type you choose to trade. This is the essential step when setting up your trades.

Step 4:Purchase a contract | Watch and purchase your contract

In this block you can specify conditions that you set for your strategy so that it can only purchase contracts when you want it. It’s important to remember that you can only purchase one contract at a time. You want to use technical analysis to identify the right moment for purchasing. We’ll cover that later in this course.

Step 5: Sell conditions | Watch and sell your purchased contract

Some contracts can be sold before expiration. You don’t have to do that, that’s why this step is optional in the control flow, however, you can do that if you wish to.

Step 6: Restart trading conditions | Get your trade result and trade again

This step is the last one in the strategy run cycle. Binary Bot and DBot go to this step immediately after a contract expires or is sold on the Step 5.

The purpose of this step is to decide whether you want to continue trading or to stop your strategy. Typically, you would need to check your stop-loss/take-profit threshold to do so. Also, you can update some variables depending on the result of the previously purchased (and expired) contract.

Here’s the example. Please note that this example is for educational purposes, it’s created to demonstrate bot run cycle. Please use your best judgement when trading.

The concept of Variables is one of the most important concepts in software programming and an essential part of almost any trading robot.

So, what is a variable?

Let’s say you are helping your friend move out of his house. The thing is, he is not good at packing. He has asked you to help him pack his stuff. Now, as you pack, you can think of the boxes as variables.

image

You can put anything you want inside, and you can replace it later with something of the same category. Then you’ll label the boxes to know what these boxes are holding in. That way, when your friend looks for the pictures of his puppy dog ‘Max’, he’ll know where to find them. This is called the Name of the variable.

Variables works the same way as this metaphor. They are a storage location with assigned names that hold data that you can use and change later. You can replace the content of a box with something else, and you can change the data stored in a variable (it’s value). That’s why they are called variables.


Creating variables

Creating variables is easy in Binary Bot and DBot. Once you created a variable, you can access if from any part of the your strategy.

So, let’s create a variable and assign it a value with DBot.


..and Binary Bot.


It’s important that you name variables meaningfully rather than undescriptive or random.

It’s like you were making donuts and you had three jars labeled x, y and z. You wouldn’t know which one’s your flour, which one’s your sugar, and which one’s your salt. Mixing up your variable names, or in this case jars, could lead to many issues… or some salty donuts.

So using meaningful names will help you easily identify the use of that variable later on in your strategy.


Assigning values to variable

Much like boxes, variables can hold a whole variety of different categories. In programming these things would be known as Data Types.

A variables data type determines the type of data that it can hold hence the name data type.

Programming languages have many different data types such as numeric, strings, boolean, etc. We won’t go into details of exactly what these data types do in this course, but remember - data types tell you what kind of values variables hold.

Binary Bot and DBot identify data types implicitly, when you assign values to variables. There are only 3 data types available: text, numbers, and boolean. In the below example, current stake is number and Text message is text.


Binary bot




DBot

Mathematical operations

There’s whole set of blocks to perform mathematical operations on variables in Binary Bot and DBot. Those blocks are available under the Math section in the Blocks menu.

Binary Bot


DBot


Operations with text

There’s a bunch of things you can do with text in Binary Bot and DBot including adding strings, splitting strings, converting them to upper or lower case, trimming spaces, etc. But the most commonly used block is the one that allows you to join strings together. Here’s how it looks like.

Binary Bot


DBot



Logical operations

Almost every trading strategy uses the logical operations. For example, a strategy can compare current price with the signal provided by a technical indicator to make a decision to purchase or sell contracts. The result of any logical operation is the logical value. In programming, the **logical value is called Boolean** value and can take one of two possible values - **True** or **False**.

Binary Bot


DBot


Conditional blocks

Probably the most important blocks in Binary Bot and DBot. It is used by all strategies. It helps Bots to be smarter and be able to make decisions about purchasing contracts and controlling the the strategy flow.

Conditional blocks allows you to perform different operations depending on the condition you specify.


DBot

In this example, bot will perform only one of 3 possible operations depending on the value of current stake.

  • If current stake is strictly less than 1, increase current stake by 1.
  • If current stake is strictly greater than 2, set current stake to 2.
  • In any other case, send Text message to Journal.