Bot run cycle

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.

Deriv (Investments) Europe Ltd (W Business Centre, Level 3, Triq Dun Karm, Birkirkara BKR 9033, Malta) is licensed in Malta and regulated by the Malta Financial Services Authority under the Investment Services Act to provide investment services in the European Union (licence no. IS/70156). It is also authorised and subject to limited regulation by the Financial Conduct Authority in the UK. Details about the extent of our authorisation and regulation by the Financial Conduct Authority are available from us on request.

Deriv (MX) Ltd, Millennium House, Level 1, Victoria Road, Douglas IM2 4RW, Isle of Man, is licensed and regulated in Great Britain by the Gambling Commission under account no. 39172 and by the Gambling Supervision Commission in the Isle of Man.

Deriv (Europe) Limited, W Business Centre, Level 3, Triq Dun Karm, Birkirkara BKR 9033, Malta, is licensed and regulated for synthetic indices by the Malta Gaming Authority (licence no. MGA/B2C/102/2000), by the Gambling Commission for clients in Great Britain (account no. 39495), and by the Revenue Commissioners for clients in Ireland (licence no. 1010285).

Deriv Investments (Europe) Ltd is authorised to deal on its own account and is both the manufacturer and distributor of its products.

This information is intended for Retail & Professional clients.

CFDs offered by Deriv Investments (Europe) Ltd are considered complex derivatives and may not be suitable for retail clients.They may be affected by changes in currency exchange rates; If you invest in this product you may lose some or all of the money you invest; The value of your investment may go down as well as up.
CFDs offered by Deriv Investments (Europe) ltd also come with a high risk of losing money rapidly due to leverage. 63% of retail investor accounts lose money when trading CFDs with Deriv Investments (Europe) ltd. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

+18 Icon Please trade responsibly. For more information about responsible trading please click here.