BotBrains
English
Search
K
Comment on page

Blocks list

Events blocks

Block
Description
Start of robot work
The block is activated once the robot is launched.
End of robot work
The block is activated once the robot is turned off.
Depth of market change
The block is activated each time the depth of market of the specified symbol changes.
New tick
The block is activated each time a new tick is received on the symbol, on the chart of which the robot was launched.
Open volume change
The block is activated each time the open volume on the specified symbol changes.
Limit order number change
The block is activated each time the number of active limit orders on the specified symbol changes.
Stop orders number change
The block is activated each time the number of active stop orders on the specified symbol changes.
Timer
The block is activated once every specified number of seconds.
Key press
The block is activated when the key with the specified code is pressed.

Condition

The "if" block is used to check certain conditions.
Block
Description
"If" block
This block is used to perform various checks. This block has 1 input and 2 outputs.

Loop

The loop block is mainly used to enumerate certain values. For example, the loop block can be used to enumerate the list of active limit orders.
Block
Description
Loop "While"
The block is activated as long as the specified condition is true.

Indicators

Trend indicators

Block
Adaptive Moving Average
Average Directional Movement Index
Average Directional Movement Index by Welles Wilder
Bollinger Bands
Double Exponential Moving Average
Envelopes
Fractal Adaptive Moving Average
Ichimoku
Moving Average
Parabolic SAR
Standard Deviation
Triple Exponential Moving Average
Variable Index Dynamic Average

Oscillators

Block
Average True Range
Bears Power
Bulls Power
Chaikin Oscillator
Commodity Channel Index
DeMarker
Force Index
MACD
Momentum
Moving Average of Oscillator
RSI (Relative Strength Index)
Relative Vigor Index
Stochastic Oscillator
TRIX (Triple Exponential Moving Averages Oscillator)
Larry Williams' Percent Range
Accumulation / Distribution
Money Flow Index
On Balance Volume
Volumes

Bill Williams

Block
Accelerator Oscillator
Alligator
Awesome Oscillator
Fractals
Gator
Market Facilitation Index

Chart analysis

Getting information about the chart and individual bars. Drawing vertical and horizontal lines on the chart.
Block
Description
Bar information
Get information on a specific chart bar.
Chart information
Get information on a specific chart. For example, get the number of available bars, get the time of the first available bar, or get the time of the last bar.
Max price
Get the maximal price of a symbol for the specified period of time.
Min price
Get the minimal price of a symbol for the specified period of time.
Average price
Get the average price of a symbol for the specified period of time.
Draw horizontal line
Draw a horizontal line on the chart of a symbol.
Draw vertical line
Draw a vertical line on the chart of a symbol.
Remove all lines
Remove all horizontal and vertical lines from the chart.

Depth of market

Getting information on the depth of market and its specific quotes.
Block
Description
Quote info
Get information on a specific quote of DOM (depth of market)
Spread
Get spread value (in ticks) of the DOM of the specified symbol.

Transactions

Place market, limit, and stop orders. Remove limit or stop orders. Close positions.
Block
Description
Market order
Place a market order.
Limit order
Place a limit order.
Remove limit order
Remove a limit order
Remove all limit orders
Remove all limit orders by the specified symbol.
Stop order
Place a stop order.
Remove stop order
Remove a stop order.
Remove all stop orders
Remove all stop orders by the specified symbol.
Close position
Close position by the specified symbol.
Close all open positions
Close all positions open by the robot.

Variables

Block
Description
Set variable simple value
The new value of the variable is specified by a single input field. That is, with this block you can write something specific to the variable - just a number or some text.
Set variable complex value
The new value of the variable is determined by the calculated value. For example, using this block you can write the current deposit value or the current price of the traded symbol into a variable.
Variable select
Variable selection. For example, the "variable select" block can be used within a condition block to check the value of a variable.

Sounds

Play sounds.
Block
Description
Smooth sound
Play "Smooth sound"
Alarm
Play "Alarm" sound
Buy signal
Play "Buy signal" sound
Sell signal
Play "Sell signal" sound

Information

Getting information about the account, positions, active and historical limit/stop orders, historical deals. Getting information about the trading session, symbol specification and time.
Block
Account information
Position information
Limit order information
All limit orders information
Stop order information
All stop orders information
History limit order information
History stop order information
History deal information
Trading session information
Symbol information
Time information

Enumerations

Enum blocks are used to enumerate something. For example, you can use enum blocks to enumerate a list of symbols or a list of active limit/stop orders.

Symbol

Blocks
Description
Symbol name
Get symbol name.

Active orders

Blocks
Description
Request active orders list
Request active orders list.
Active limit order ticket
Get active limit order ticket.
Active stop order ticket
Get active stop order ticket.
Be sure to use "Request list active orders list" block before enumeration of the list of active orders. Otherwise you will work with irrelevant data.

History

Block
Description
Request history
Request history for the specified period of time.
History deal ticket
Get history deal ticket.
History limit order ticket
Get history limit order ticket.
History stop order ticket
Get history stop order ticket.
Be sure to call the "Request history" block before enumerating the list of historical orders and deals. Otherwise you will work with irrelevant data.

Telegram

Using special blocks your robot can send messages and charts screenshots directly to your telegram.
Make sure that you specify your telegram bot's token in the robot's settings. This procedure is described in detail in the corresponding article.
Block
Description
Send message
Send a telegram message to the user with the specified ID.
Send chart screenshot
Send a chart screenshot to the user with the specified ID.
New line
This block is used to create a line break in a Telegram message.

Other blocks

Block
Description
Journal message
Print a message to the terminal journal.
Terminal alert
Make a notification in the terminal.
Chart comment
Show comment on the chart of the specified symbol.
Log to file
Make a log into the robot's log file.
Pause
Pause the robot for the specified number of milliseconds.
Turn the robot off
Turn the robot off.
Close terminal
Close the terminal.

Interface

With these blocks, you can create full-fledged robot interfaces. With the help of special blocks, you can change the properties of interface elements and get information on them.

Elements

Block
Description
Rectangle
"Rectangle" interface element.
Button
"Button" interface element.
Text
"Text" interface element.
Value input
"Value input" interface element.

Modifications

Block
Description
Modify interface element
Change a certain property of an interface element.

Information

Block
Description
Interface element info
The block returns the value of the specified property of the interface element block with the specified ID.
Working with the interface blocks is described in more detail in the corresponding article.

Predefined constants

Predefined constants are possible values of certain properties. For example, the "direction" block contains predefined constants of possible directions: buy, sell, no direction.
Block
Description
Direction
Possible position directions (buy, sell, no direction)
Deal entry
Possible deal entries (entry in, entry out, reverse, close a position by an opposite one)
Deal type
Possible deal types (buy, sell, balance, credit, correction, etc.)

Debug

The "print debug info" has many uses. It is mainly used to check the values of variables and the values that blocks return.
Block
Description
Print debug info
Prints the specified message to the terminal journal.

Mathematical operators

Block
Description
+
Addition
-
Subtraction
/
Division
*
Multiplication
Square root
^
Exponentiation
%
Division remainder
(
Opening parenthesis
)
Closing parenthesis
>
Greater
<
Less
>=
Greater or equal
<=
Less or equal

Logical operators

Block
Description
AND
Logical "AND"
OR
Logical "OR"
NOT
Logical "NOT"

Teleports

Teleports are used when it is necessary to switch to the execution of another part of the scheme. Input and output teleports are linked by number.
Block
Teleport IN
Teleport OUT

Variable or constant select

Block
Variable select
Constant select

Value input

Block
Description
Value input
This block can be used to set certain values right in the scheme.

Type conversion

By default, all data is represented as a number. With type conversion blocks you can explicitly specify the format in which a certain value must be represented.
Working with types is described in the corresponding article in more detail.
Block
Description
Regular string
Convert the value to a regular string.
Date and time format string
Convert the value to the date and time format.
Integer
Convert the value to an integer.
Fraction
Convert the value to a fraction.