Official blocks: Tools (the Utility menu)

Plain-English guide to the Tools blocks for messages, Telegram, time, candles, balance and profit, with simple examples to use in your Bot Builder bot.

The Tools blocks are the helpers of the Bot Builder. They show messages, wait for a while, turn dates into numbers, read candles and tell you your balance and profit. The Notifications, Time and Miscellaneous blocks sit in the Utility menu, the candle blocks sit in the Analysis menu under Tick and candle analysis, and Account balance, Total profit/loss and Number of runs sit in Analysis under Stats. Action blocks go inside a root block such as Purchase conditions and run in the order the bot reaches them, while value blocks plug into sockets. Words used below: a tick is one new price from the market, a candle is a summary of one slot of time (the open, high, low and close price), the Journal is the list of messages in the run panel, and epoch time is the count of seconds since 1 January 1970. None of these blocks buys or sells, and none of them protects your money by itself.

Notifications

Notify

  • Kind: Official (Deriv)
  • Type id: notify
  • Shape: Action block
  • Where it goes: Inside a root block such as 2. Purchase conditions, 3. Sell conditions or 4. Restart trading conditions (also inside a function or a Run on every tick block). You can use it as many times as you like.
  • What it does: Shows a coloured message in the Journal (the list of messages in the run panel) and can play a sound. Use it to tell yourself what your bot is doing. It does not stop the bot and does not change any trade.
  • Inputs:
    • Colour dropdown: green, blue, yellow or red. The block from the menu starts on green.
    • Sound dropdown: Silent, Announcement, Earned money, Job done, Error or Severe error. Default: Silent.
    • Message socket: the text or value to show. It must be filled.
  • How it works: When the bot reaches this block it sends the colour, the message and the sound to the Journal, then carries on with the next block. The message can be a text, a number or a variable.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Notify [ green ▾ ] with sound: [ Earned money ▾ ]          │
│        ( "Round finished" )                                │
│ Trade again                                                │
└────────────────────────────────────────────────────────────┘

After every round the bot writes a green "Round finished" line in the Journal, plays the Earned money sound, then trades again.

  • Good to know:
    • An empty Message socket turns the block red and the bot will not start.
    • The colour is only a label for you. A red message does not mean a loss and a green one does not mean a win.
    • Sounds depend on your device. If your phone is on silent you may hear nothing.

Notify Telegram

  • Kind: Official (Deriv)
  • Type id: notify_telegram
  • Shape: Action block
  • Where it goes: Inside a root block such as 2. Purchase conditions, 3. Sell conditions or 4. Restart trading conditions (also inside a function or a Run on every tick block). You can use it as many times as you like.
  • What it does: Sends a message to a Telegram chat, so you get your bot's news on your phone while you are away from the screen. The page must stay open for the bot to keep running.
  • Inputs:
    • Access Token socket: the secret token of your Telegram bot. It must be filled.
    • Chat ID socket: the number of the chat that should get the message. It must be filled.
    • Message socket: the text to send. It must be filled.
  • How it works: The bot sends one request over the internet to Telegram's web address, using your token, your chat id and your text. It does not wait for the answer. If Telegram refuses or the request fails, a yellow note "The Telegram notification could not be sent" appears in the Journal and the bot carries on.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Notify Telegram                                            │
│   Access Token: ( "123456:ABC..." )                        │
│   Chat ID: ( "987654321" )                                 │
│   Message: ( "Round finished" )                            │
└────────────────────────────────────────────────────────────┘

After a round, the bot sends "Round finished" to your Telegram chat.

  • Good to know:
    • Treat the token like a password. It is saved as plain text inside your bot file, so do not share or post a bot file that holds a real token.
    • If any of the three sockets is empty, the block is marked red and the bot will not start.
    • A message that is sent is not a promise it arrives. Check your chat the first time.

Time

Seconds Since Epoch

  • Kind: Official (Deriv)
  • Type id: epoch
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a value is wanted (a socket in an if, a Compare, a Set variable and so on). You can use it as many times as you like.
  • What it does: Gives the current time as one whole number: the seconds that have passed since 1 January 1970 (computers call this the Unix epoch). It is the easy way to measure how long something took.
  • Gives back: A whole number of seconds, for example 1767225600.
  • How it works: The block reads the clock of your own device, divides the milliseconds by 1000 and drops the decimals. Run it twice and subtract to get the seconds between two moments.
  • Example:
┌─ 2. Purchase conditions ───────────────────────────────────┐
│ if  < ( Seconds Since Epoch ) ≥ ( start + 3600 ) >         │
│ then  Notify [ blue ▾ ] with sound: [ Silent ▾ ]           │
│          ( "1 hour" )                                      │
└────────────────────────────────────────────────────────────┘

Here "start" is a variable that was set earlier to the same block. When an hour (3600 seconds) has passed, the bot shows a blue note.

  • Good to know:
    • It uses your device clock, not Deriv's clock. A wrong clock on your phone gives wrong numbers.
    • Seconds only: there are no fractions of a second.

Delayed run

  • Kind: Official (Deriv)
  • Type id: timeout
  • Shape: Action block
  • Where it goes: Inside a root block such as 2. Purchase conditions, 3. Sell conditions or 4. Restart trading conditions (also inside a function or a Run on every tick block). You can use it as many times as you like.
  • What it does: Waits a number of seconds and then runs the blocks you put inside it. The rest of your bot waits too.
  • Inputs:
    • Statement slot (the open space on the block): the blocks to run after the wait.
    • Run after ... second(s) socket: how many seconds to wait. It must be filled.
  • How it works: The bot pauses for the number of seconds you gave, then runs the blocks inside, then goes on to the next block under this one. Nothing else in your strategy moves during the wait.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Delayed run                                                │
│   Notify [ blue ▾ ] with sound: [ Silent ▾ ] ( "Back" )    │
│   Run after ( 5 ) second(s)                                │
│ Trade again                                                │
└────────────────────────────────────────────────────────────┘

The bot waits 5 seconds, writes "Back" in the Journal, and then trades again.

  • Good to know:
    • Because the whole bot waits, a long delay means you skip the market in the meantime.
    • To wait for price updates instead of seconds, use Tick Delayed run.

Tick Delayed run

  • Kind: Official (Deriv)
  • Type id: tick_delay
  • Shape: Action block
  • Where it goes: Inside a root block such as 2. Purchase conditions, 3. Sell conditions or 4. Restart trading conditions (also inside a function or a Run on every tick block). You can use it as many times as you like.
  • What it does: Waits for a number of ticks (a tick is one new price from the market) and then runs the blocks inside it. The rest of your bot waits too.
  • Inputs:
    • Statement slot: the blocks to run after the wait.
    • Run after ... tick(s) socket: how many ticks to wait. If it is left out the code uses 1.
  • How it works: The bot starts watching the prices of the market set in Trade parameters, counts the new ticks as they arrive, and when it has counted your number it runs the blocks inside. Then it continues with the block under this one.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Tick Delayed run                                           │
│   Notify [ blue ▾ ] with sound: [ Silent ▾ ] ( "3 ticks" ) │
│   Run after ( 3 ) tick(s)                                  │
│ Trade again                                                │
└────────────────────────────────────────────────────────────┘

The bot lets 3 new prices go by, writes "3 ticks", and then trades again.

  • Good to know:
    • A negative number is refused. The block turns red with the message "Values cannot be negative" and the bot will not start.
    • A value the block cannot work out (not a number and not a variable) is refused with "Invalid Input".
    • How long a tick takes depends on the market, so this is not a fixed number of seconds.

Convert to timestamp

  • Kind: Official (Deriv)
  • Type id: totimestamp
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a value is wanted (a socket in an if, a Compare, a Set variable and so on). You can use it as many times as you like.
  • What it does: Turns a date and time written as text into one number: the seconds since 1 January 1970 (the Unix epoch).
  • Inputs:
    • Text socket: a date like 2025-03-01 or a date and time like 2025-03-01 21:03:45. The menu block starts with the text yyyy-mm-dd hh:mm:ss. It must be filled.
  • Gives back: A number of seconds. If the text cannot be read, it gives the words "Invalid date/time:" followed by your text.
  • How it works: The block keeps only digits and the signs - . : and spaces. It accepts a year, month and day (YYYY-MM-DD) and, after a space, hours and minutes with optional seconds (hh:mm or hh:mm:ss). Any time-zone words such as GMT+0800 are thrown away, so the time is read as time on your own device.
  • Example:
┌─ 2. Purchase conditions ───────────────────────────────────┐
│ set [ start ▾ ] to                                         │
│   ( To timestamp ( "2025-03-01 21:03:45" ) )               │
└────────────────────────────────────────────────────────────┘

The variable "start" now holds the number for that moment, ready to compare with Seconds Since Epoch.

  • Good to know:
    • The time zone you type is ignored. Two people in different time zones get different numbers from the same text.
    • Write the date exactly as year-month-day with two digits for month and day.
    • Check the result for the words "Invalid date/time" before you do maths with it.

Convert to date/time

  • Kind: Official (Deriv)
  • Type id: todatetime
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a value is wanted (a socket in an if, a Compare, a Set variable and so on). You can use it as many times as you like.
  • What it does: Turns a number of seconds since 1 January 1970 (the Unix epoch) into a readable date and time.
  • Inputs:
    • Number socket: the seconds to convert. It must be filled. The menu block starts with 0.
  • Gives back: Text such as 2019-01-01 13:03:45 GMT+0000. If the number is not a real time it gives "Invalid timestamp:" followed by the number.
  • How it works: The block builds the text year-month-day hours:minutes:seconds in the time zone of your own device and adds the zone at the end as GMT plus or minus hours and minutes.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Notify [ blue ▾ ] with sound: [ Silent ▾ ]                 │
│   ( To date/time ( Seconds Since Epoch ) )                 │
└────────────────────────────────────────────────────────────┘

The Journal shows the time of this moment, for example 2025-03-01 21:03:45 GMT+0000.

  • Good to know:
    • The text uses your device time zone, so the same number looks different on a device in another zone.
    • The socket takes numbers only.
    • The number 0, which is the value the menu block starts with, gives "Invalid timestamp: 0".

Miscellaneous

Loads from URL

  • Kind: Official (Deriv)
  • Type id: loader
  • Shape: Stand-alone block (no dents; it does not plug into other blocks)
  • Where it goes: Straight on the empty canvas, as its own stand-alone block. It does not plug into other blocks. Several are allowed, but each needs its own web address.
  • What it does: Loads extra blocks from a block file (an .xml file) kept on a web address, and adds them to your canvas.
  • Inputs:
    • Web address box: the address of the block file. The new block starts with http://www.example.com/block.xml.
  • How it works: When you place the block, or change its address, or open a saved bot that contains it, the page fetches the file and adds the blocks to the canvas. If you change the address, the blocks it added before are removed first. An address with no http gets http:// put in front. An address that ends in / gets index.xml added. The block itself adds no code to your bot.
  • Example:
┌─ Loads from URL ───────────────────────────────────────────┐
│ Load block from URL:                                       │
│ [ http://www.example.com/block.xml ]                       │
└────────────────────────────────────────────────────────────┘

The page fetches that file and the blocks inside it appear on your canvas.

  • Good to know:
    • Only load files you made or fully trust. Blocks from a stranger's address become part of your bot.
    • The address must end in a file name with a three-letter ending such as .xml, or end with /. Otherwise you get "Target must be an XML file".
    • A second block with an address that is already loaded is switched off ("This URL is already loaded"). A failed load shows "An error occured while trying to load the URL" and switches the block off.

Ignore

  • Kind: Official (Deriv)
  • Type id: block_holder
  • Shape: Stand-alone block (it has an open slot but no dents; it does not plug into other blocks)
  • Where it goes: Straight on the empty canvas, as its own stand-alone block. It does not plug into other blocks.
  • What it does: A parking space for blocks. Everything you put inside it is kept on the canvas but is never run.
  • Inputs:
    • Statement slot: drop any blocks here. The title on the block reads Ignore.
  • How it works: The block creates no code, so the bot skips everything inside it. Before a run the bot switches off loose blocks that sit outside a root block, but this block is allowed to stay on its own, so what is inside is kept safe.
  • Example:
┌─ Ignore ───────────────────────────────────────────────────┐
│ Ignore                                                     │
│   Notify [ red ▾ ] with sound: [ Error ▾ ] ( "old idea" )  │
└────────────────────────────────────────────────────────────┘

The Notify block is saved with your bot but does nothing when the bot runs.

  • Good to know:
    • Use it to keep an old idea without deleting it.
    • Moving a block out of Ignore and into a root block makes it live again.

Console

  • Kind: Official (Deriv)
  • Type id: console
  • Shape: Action block
  • Where it goes: Inside a root block such as 2. Purchase conditions, 3. Sell conditions or 4. Restart trading conditions (also inside a function or a Run on every tick block). You can use it as many times as you like.
  • What it does: Writes a value to the browser's developer console, a technical window meant for programmers. It does not show in the Journal.
  • Inputs:
    • Type dropdown: Log, Warn, Error or Table. Default: Log.
    • Value socket: the text, number, true/false or list to write. It must be filled.
  • How it works: The bot calls the browser's own console with the type you chose and your value. Table is meant for lists and shows them as rows. If the socket is empty the code writes the words <empty message>.
  • Example:
┌─ 2. Purchase conditions ───────────────────────────────────┐
│ Console [ Log ▾ ] value: ( Last Digit )                    │
└────────────────────────────────────────────────────────────┘

Each time this runs, the last digit is written to the developer console.

  • Good to know:
    • On a phone you usually cannot open the developer console. Use Notify if you want to read it.
    • It never changes a trade.

In the Analysis menu

Account balance

  • Kind: Official (Deriv)
  • Type id: balance
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a number or text is wanted. It sits in the Analysis menu under Stats.
  • What it does: Gives the money in your account, either as a number you can calculate with or as ready-to-show text.
  • Inputs:
    • Type dropdown: string or number. The block starts on string.
  • Gives back: With number: your balance as a plain number (0 if no balance is known yet). With string: text with thousands commas and the currency, such as 10,000.00 USD.
  • How it works: The block reads the last balance the page knows about for the account that is logged in. The dropdown also changes the plug of the block between text and number so it fits the right sockets. On the block it reads Balance: ...
  • Example:
┌─ 2. Purchase conditions ───────────────────────────────────┐
│ if  < Balance: [ number ▾ ] ≥ ( 20 ) >                     │
│ then  Purchase [ Rise ▾ ]                                  │
└────────────────────────────────────────────────────────────┘

The bot only buys while the balance is at least 20.

  • Good to know:
    • Use number for maths and comparisons, and string for messages.
    • It only reads the balance. It does not stop the bot or protect your money by itself.
    • A balance of 0 can also mean that the balance has not arrived yet.

Total profit/loss

  • Kind: Official (Deriv)
  • Type id: total_profit
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a number is wanted. It sits in the Analysis menu under Stats.
  • What it does: Gives the total profit or loss of your bot since it started, as one number. Wins add to it and losses take away from it.
  • Gives back: A number in your account currency. A negative number means the bot is down overall.
  • How it works: The block reads the running total that the page keeps for the account. The total is reset when you click Clear stats in the Transaction Stats window, or when you refresh the page.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ if  < Total profit/loss ≤ ( -50 ) >                        │
│ then  Notify [ red ▾ ] with sound: [ Error ▾ ]             │
│          ( "Down 50" )                                     │
└────────────────────────────────────────────────────────────┘

When the bot is down 50 or more, it writes a red note. It does not stop by itself; you would build the stop yourself.

  • Good to know:
    • It counts the whole run of the bot, not only the last round.
    • It reports a number. It does not protect you from losses.

Number of runs

  • Kind: Official (Deriv)
  • Type id: total_runs
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a number is wanted. It sits in the Analysis menu under Stats.
  • What it does: Gives how many times your bot has run a trade since the stats were last cleared.
  • Gives back: A whole number, starting at 0.
  • How it works: The block reads the running count that the page keeps for the account. The count is reset when you click Clear stats in the Transaction Stats window, or when you refresh the page.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ if  < Number of runs ≥ ( 10 ) >                            │
│ then  Notify [ blue ▾ ] with sound: [ Job done ▾ ]         │
│          ( "10 runs" )                                     │
└────────────────────────────────────────────────────────────┘

After 10 runs, the bot writes a blue note and plays the Job done sound.

  • Good to know:
    • Useful to stop or change something after a set number of trades by comparing it with a number.
    • It counts trades, not wins.

Not in the menu

Total Profit String

  • Kind: Official (Deriv)
  • Type id: total_profit_string
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Anywhere a value is wanted. It is not in the Bot Builder menu; it only exists for bots that already use it.
  • What it does: Gives the total profit or loss of your bot, rounded to the number of decimals of your account currency. On the block it reads Total Profit String.
  • Gives back: The total profit or loss, rounded. The block is typed as text. Not confirmed in the code: whether the value is text or a number.
  • How it works: It reads the same running total as Total profit/loss and rounds it to the decimals of the account currency. The total is reset by Clear stats or by refreshing the page.
  • Example:
┌─ 4. Restart trading conditions ────────────────────────────┐
│ Notify [ blue ▾ ] with sound: [ Silent ▾ ]                 │
│   ( Total Profit String )                                  │
└────────────────────────────────────────────────────────────┘

The Journal shows the total so far, for example 12.5.

  • Good to know:
    • You will not find it in the menu. For new bots use Total profit/loss.
    • A total of exactly 0 is given as 0.

Barrier offset (old)

  • Kind: Official (Deriv)
  • Type id: barrier_offset
  • Shape: Value block (gives a number, text, list...)
  • Where it goes: Nowhere new. It is not in the Bot Builder menu. It stays in the program only so that very old bots still open.
  • What it does: A leftover from a very old Binary Bot version. A barrier is the price line a contract is measured against, and this block once set it as a plus or minus offset.
  • Inputs:
    • Dropdown: Offset + or Offset -.
  • Gives back: Nothing. It creates no code and gives no value.
  • How it works: The block is kept for backward compatibility. When the bot is built, this block produces nothing.
  • Example:
┌─ Barrier offset ───────────────────────────────────────────┐
│ [ Offset + ▾ ]                                             │
└────────────────────────────────────────────────────────────┘

The block sits there but has no effect on the bot.

  • Good to know:
    • Do not use it in new bots.
    • For a barrier offset, use the Offset + / Offset - choice in the Trade options block of Trade parameters.

Conversion Helper Block

  • Kind: Official (Deriv)
  • Type id: useless_block
  • Shape: Action block
  • Where it goes: Nowhere new. It is not in the Bot Builder menu. It appears when the page converts a very old strategy.
  • What it does: A filler block that the page adds when it converts an old strategy so that the converted blocks fit together.
  • How it works: The block creates no code. The bot skips it and carries on with the next block.
  • Example:
┌─ Conversion Helper Block ──────────────────────────────────┐
│ Conversion Helper Block                                    │
└────────────────────────────────────────────────────────────┘

The block sits in the stack and has no effect when the bot runs.

  • Good to know:
    • The tooltip says: "This block was required to correctly convert your old strategy."
    • You can leave it where it is.

Build a bot with these blocks

BRINOVS is free to open. Sign in with Deriv, open the Bot Builder, and try everything on a demo account.

Open BRINOVS

BRINOVS Digits is a free bot builder and trading page built on Deriv's Bot Builder. Trading carries risk and you can lose money. Nothing in this guide is financial advice or a promise of profit. Test every bot on a demo account first.

Guide home · Open BRINOVS