43 KiB
title, summary, sidebar, permalink, toc
| title | summary | sidebar | permalink | toc |
|---|---|---|---|---|
| Network Hierarchy | Hover your mouse over a node for a quick definition, and click for the details. | suite_sidebar | suite-network-hierarchy.html | false |
Network
{{site.data.network.network}}
You will use the network hierarchy for three main purposes:
-
To control processes running sensor and indicator bots. These keep your data feeds up to date so that you may trade live.
-
To control sessions.
-
To set up which data products will be made available to your strategies, and for visualization purposes on the charts.
Network Node
{{site.data.network.network_node}}
At the moment, processes run locally in a network node representing your computer. In the future, you will also be able to deploy other nodes, such as virtual machines in the cloud, and control execution in those remote computers from within your local instance of the system.
In a more distant future, you will also be able to connect to and consume services from other people’s nodes.
Task Manager
{{site.data.network.task_manager}}
A task manager facilitates the organization of tasks. For example, you may wish to set up a task manager to handle tasks related to a particular set of indicators you use with a certain strategy. Or, for example, to organize multiple backtesting sessions.
Also, a task manager allows starting and stopping all tasks under it at once, with a single click.
Adding a Task Manager
To add a task manager, select Add Task Manager on the My Computer network node menu. A task manager is added along with a task.
Starting / Stopping All Tasks
Select Run All Tasks or Stop All Tasks on the menu to start and stop all tasks respectively.
Task
{{site.data.network.task}}
Each task may control a single bot. A bot instance running on its own task is independent from other bots at the operating system level, thus, may not be affected by errors ocurring on those other bots.
Adding a Task
To add a task, select Add Task on the task manager node menu.
{% include tip.html content="Instead of adding nodes, configuring them, and setting references one by one, you may want to clone an existing, fully functional task with all its offspring." %}
Starting / Stopping a Task
Select Run on the menu to start a task. When a task is started, the process instance of the bot instance attached to the task is started. Also, a visual indication that both the task and the process instance are running appear surrounding the corresponding nodes, in the form of a progress ring.
[IMAGE]
To stop a task, select Stop on the menu.
Sensor Bot Instance
{{site.data.network.sensor_bot_instance}}
{{site.data.concepts.sensor_bot}}
The sensor bot instance holds no definitions as to what the bot does. Instead, its process instance references a process definition in the corresponding data mine. That is how the sensor bot instance obtains the information regarding what it needs to do once it is run.
Adding a Sensor Bot Instance
To add a sensor bot instance, select Add Sensor Bot Instance on the task node menu. When a sensor bot instance is added, it is created with one sensor process instance, and a market reference.
Starting / Stopping a Sensor Bot Instance
You do not start or stop a sensor bot instance directly. Instead, you start or stop the corresponding task.
Configuring a Sensor Bot Instance
Select Configure Sensor Bot Instance on the menu to access the configuration.
{
"startDate": "2020-01-01"
}
startDateis the starting date of the data product the sensor bot instance builds. In other words, the sensor bot instance queries its data source for data starting on the configuredstartDate. In cases when the sensor bot has built a data product starting on a certain date and thestartDateis eventually changed for an earlier one, that is, a date further in the past, then the sensor bot discards the existing data product and starts over from the newly configured date.
Sensor Process Instance
{{site.data.network.sensor_process_instance}}
For example, in the case of an instance of the Masters data mine Charly sensor bot, the sensor bot process instance references the Historic Trades process definition. Once the reference is established, the sensor process instance adopts the name of the process definition it references.
Adding a Sensor Process Instance
To add a sensor process instance, select Add Sensor Process Instance on the sensor bot instance node menu. When a sensor process instance is added, it is created with a market reference.
Starting / Stopping a Sensor Process Instance
You do not start or stop a sensor process instance directly. Instead, you start or stop the corresponding task.
Indicator Bot Instance
{{site.data.network.indicator_bot_instance}}
{{site.data.concepts.indicator_bot}}
The indicator bot instance holds no definitions as to what the bot does. Instead, its processes instances reference the process definitions in the corresponding data mine. That is how the indicator bot instance obtains the information of what it needs to do once it is run.
Adding an Indicator Bot Instance
To add an indicator bot instance, select Add Indicator Bot Instance on the task node menu. When an indicator bot instance is added, it is created with one indicator process instance, and a market reference.
Starting / Stopping an Indicator Bot Instance
You do not start or stop an indicator bot instance directly. Instead, you start or stop the corresponding task.
Indicator Process Instance
{{site.data.network.indicator_process_instance}}
Indicator bot instances usually require two indicator process instances. One of them references the indicator's multi-period-market process definition and the second references the multi-period-daily process definition.
Once the reference is established, the indicator process instance adopts the name of the process definition it references.
Adding an Indicator Process Instance
To add an indicator process instance, select Add Indicator Process Instance on the indicator bot instance node menu. When an indicator process instance is added, it is created with a market reference.
Starting / Stopping an Indicator Process Instance
You do not start or stop an indicator process instance directly. Instead, you start or stop the corresponding task.
Market Reference
{{site.data.network.market_reference}}
In other words, a market reference is the piece of information that let's the process instance know which market of which exchange it needs to process.
Adding a Market Reference
To add a market reference, select Add Market Reference on the sensor, indicator or trading process instance node menu.
{% include note.html content="After adding a market reference node, make sure you establish the reference to the corresponding market of the corresponding exchange in the Crypto Ecosystem hierarchy." %}
Key Instance
{{site.data.network.key_instance}}
The key instance must be attached to market reference nodes that participate in forward testing and live trading sessions, as that is the scenario in which the user must validate the account with the exchange.
Some exchanges—like Binance—require validating the user even when retrieving data from the exchange. For such reasons, the key instance must also be attached to the market reference of the sensor process instance that connects to such exchanges.
In all cases, the key instance node must reference a valid exchange account key from an account with the exchange, as defined in the Crypto Ecosystem hierarchy.
{% include important.html content="Most exchanges do not allow the same exchange account key to be used with multiple processes querying the exchange API. This means that if you are trading with multiple trading systems or multiple sessions on the same exchange, each session requires different exchange account keys." %}
Adding a Key Instance
To add a key instance, select Add Key Instance on the market reference node menu.
{% include note.html content="Remember to establish a reference with a valid exchange account key after creating the key instance." %}
Trading Bot Instance
{{site.data.network.trading_bot_instance}}
{{site.data.concepts.trading_bot}}
The trading bot instance holds no definitions as to what the bot does. Instead, its process instance references the process definition in the Masters data mine. That is how the indicator bot instance obtains the information of what it needs to do once it is run.
Adding a Trading Bot Instance
To add a trading bot instance, select Add Trading Bot Instance on the task node menu. When a trading bot instance is added, it is created with one trading process instance, and a market reference.
Starting / Stopping a Trading Bot Instance
You do not start or stop a trading bot instance directly. Instead, you start or stop the corresponding task.
Trading Process Instance
{{site.data.network.trading_process_instance}}
The trading process instance must reference the Multi-Period process definition of the Jason trading bot in the Masters data mine.
Adding a Trading Process Instance
To add a trading process instance, select Add Trading Process Instance on the trading bot instance node menu. When a trading process instance is added, it is created with a market reference.
{% include note.html content="After adding a trading process instance node, make sure you establish the reference to the Multi-Period process definition of the Jason trading bot in the Masters data mine." %}
Starting / Stopping a Trading Process Instance
You do not start or stop a trading process instance directly. Instead, you start or stop the corresponding task.
Backtesting Session
{{site.data.network.backtesting_session}}
A backtesting session node must reference a trading system to gain access to the trading logic to be applied during the session. Other considerations framing the session come from the set of parameters attached to it.
Adding a Backtesting Session
To add a backtesting session, select Add Backtesting Session on the trading process instance node menu. When a session is added, it is created with the full set of parameters.
{% include note.html content="After adding a session node, make sure you establish a reference to the trading system you want it to work with." %}
Configuring a Backtesting Session
Select Configure Session on the menu to access the configuration.
{
"folderName": "Session-Name"
}
folderNameallows you to set a significant name to the folder in which the data products—and logs—generated by the session are stored. If left blank, the system names the folders with the session id. This may be handy when you intend to consult the raw data generated by the session, as, otherwise, the folder would be hard to identify.
Starting / Stopping a Backtesting Session
Before you start a backtesting session, the corresponding task needs to be running, as it is the task that puts the trading bot instance to run. Once the trading bot instance is running, select Run on the menu to start the session.
After a few seconds, a literal indication of the progress of the calculations appears below the session node, displaying the date that is currently being processed. Once the calculation is finished, the session stops and the date below the session node dissapears.
[IMAGE]
To stop a backtesting session, select Stop on the menu.
Paper Trading Session
{{site.data.network.paper_trading_session}}
A paper trading session node must reference a trading system to gain access to the trading logic to be applied during the session. Other considerations framing the session come from the set of parameters attached to it.
Adding a Paper Trading Session
To add a paper trading session, select Add Paper Trading Session on the trading process instance node menu. When a session is added, it is created with the full set of parameters.
{% include note.html content="After adding a session node, make sure you establish a reference to the trading system you want it to work with." %}
Configuring a Paper Trading Session
Select Configure Session on the menu to access the configuration.
{
"folderName": "Session-Name"
}
folderNameallows you to set a significant name to the folder in which the data products—and logs—generated by the session are stored. If left blank, the system names the folders with the session id. This may be handy when you intend to consult the raw data generated by the session, as, otherwise, the folder would be hard to identify.
Starting / Stopping a Paper Trading Session
Before you start a paper trading session, the corresponding task needs to be running, as it is the task that puts the trading bot instance to run. Once the trading bot instance is running, select Run on the menu to start the session.
To stop a backtesting session, select Stop on the menu.
Forward Testing Session
{{site.data.network.forward_testing_session}}
A forward testing session node must reference a trading system to gain access to the trading logic to be applied during the session. Other considerations framing the session come from the set of parameters attached to it.
Adding a Forward Testing Session
To add a forward testing session, select Add Forward Testing Session on the trading process instance node menu. When a session is added, it is created with the full set of parameters.
{% include note.html content="After adding a session node, make sure you establish a reference to the trading system you want it to work with." %}
Configuring a Forward Testing Session
Select Configure Session on the menu to access the configuration.
{
"folderName": "Session-Name",
"balancePercentage": 1
}
-
folderNameallows you to set a significant name to the folder in which the data products—and logs—generated by the session are stored. If left blank, the system names the folders with the session id. This may be handy when you intend to consult the raw data generated by the session, as, otherwise, the folder would be hard to identify. -
balancePercentageis a number defining the percentage of the initialBalance specified in the base aset configuration that will be used for trading. For instance,"balancePercentage": 1means that 1% of your balance will be made available. Just like theinitialBalanceis scaled down, theminimumBalanceandmaximumBalanceare also scaled down accordingly (see base asset).
Let's draw a quick example:
Your base asset is USDT and your initialBalance is USDT 10,000.
If you set up your forward-testing session with "balancePercentage": "1", then USDT 10,000 * 1% = USDT 100. This is the balance that will be available to your forward-testing session.
{% include important.html content="You need to take this into account at the time of defining your positionSize formula. If the formula is a constant, you may easily run out of balance, as only a fraction of the balance will be available for the strategy to use. It may be a good idea to set up your positionSize as a function of your available balance instead." %}
Starting / Stopping a Forward Testing Session
Before you start a forward testing session, the corresponding task needs to be running, as it is the task that puts the trading bot instance to run. Once the trading bot instance is running, select Run on the menu to start the session.
To stop a backtesting session, select Stop on the menu.
Live Trading Session
{{site.data.network.live_trading_session}}
A live trading session node must reference a trading system to gain access to the trading logic to be applied during the session. Other considerations framing the session come from the set of parameters attached to it.
Adding a Live Trading Session
To add a live trading session, select Add Live Trading Session on the trading process instance node menu. When a session is added, it is created with the full set of parameters.
{% include note.html content="After adding a session node, make sure you establish a reference to the trading system you want it to work with." %}
Configuring a Live Trading Session
Select Configure Session on the menu to access the configuration.
{
"folderName": "Session-Name"
}
folderNameallows you to set a significant name to the folder in which the data products—and logs—generated by the session are stored. If left blank, the system names the folders with the session id. This may be handy when you intend to consult the raw data generated by the session, as, otherwise, the folder would be hard to identify.
Starting / Stopping a Live Trading Session
Before you start a live trading session, the corresponding task needs to be running, as it is the task that puts the trading bot instance to run. Once the trading bot instance is running, select Run on the menu to start the session.
To stop a backtesting session, select Stop on the menu.
Parameters
{{site.data.trading_system.parameters}}
Each testing session has its own set of parameters. This allows you to configure different trading sessions with different parameters, and go back and forth between them as required. For instance, you may have different backtesting sessions with different date ranges, different exchange fees or different slippage settings.
Adding Parameters
To add a parameters node, select Add Parameters on the session or the trading system menu, depending on the context. When a parameters node is added, the full set of parameters are created with it.
If you already have a parameters node but are missing some of the parameters, then select Add Missing Params on the menu.
Base Asset
{{site.data.trading_system.base_asset}}
The basse asset must reference an asset in a specific market of a specific exchange in the Crypto Ecosystem hierarchy.
Adding a Base Asset
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
{% include note.html content="After adding a base asset node, make sure you establish a reference to the asset in a specific market of a specific exchange in the Crypto Ecosystem hierarchy." %}
Configuring the Base Asset
Select Configure Base Asset on the menu to access the configuration.
{
"initialBalance": 0.001,
"minimumBalance": 0.0001,
"maximumBalance": 0.1
}
-
initialBalanceis the amount of capital you wish to allocate to the trading system. -
minimumBalanceis the threshold of accummulated losses that switches off the session; when your overall balance (balanceAssetA + balanceAssetB) drops to this value, all trading stops; think of theminimumBalanceas a general safety switch. -
maximumBalanceis a similar concept as with theminimumBalancebut on the high side of theinitialBalance.
Quoted Asset
{{site.data.trading_system.quoted_asset}}
The quoted asset must reference the second asset in the same market of the same exchange as the reference established with the base asset.
Adding a Quoted Asset
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
{% include note.html content="After adding a quoted asset node, make sure you establish a reference to the second asset in the same market of the same exchange as the reference established with the base asset." %}
Time Range
{{site.data.trading_system.time_range}}
Adding a Time Range
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
Configuring the Time Range
Select Configure Time Range on the menu to access the configuration. The configuration varies slightly depending on the type of session you are running.
On Backtesting Sessions
{
"initialDatetime": "2019-09-01T00:00:00.000Z",
"finalDatetime": "2019-09-25T00:00:00.000Z"
}
-
initialDatetimeis the datetime the session starts at. If you don't set an initialDatetime the system's fallback mechanism will try to get it from the parameters defined at the level of the trading system. -
finalDatetimeis the datetime the session finishes at. If you don't set a finalDatetime at the level of the testing session or the trading system, then calculations will run until the date there is data available.
On Paper Trading, Forward Testing and Live Trading Sessions
These sessions always start at the datetime the session is run, therefore, there is no configuration of an initial datetime.
{
"finalDatetime": "2019-09-25T00:00:00.000Z"
}
finalDatetimeis the datetime the session finishes at. If you don't set a finalDatetime at the level of the testing session or the trading system, then the session runs for one year.
Time Frame
{{site.data.trading_system.time_frame}}
In the context of backtesting sessions, what time frame you decide to run the session on depends on the strategies being tested. If strategies make decisions based on the 1 hour candle and above, then 01-hs may be the best choice. However, if decisions are influenced by sub-hour candles then you should match the time frame accordingly.
In the context of live sessions, that is, paper trading, forward testing and live trading, you should run the session on the 01-min time frame so that the trading bot reacts fast when the price tags the take profit or stop loss targets.
Adding a Time Frame
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
Configuring the Time Frame
Select Configure Time Frame on the menu to access the configuration.
{
"value": "01-min"
}
valueis the setting for the time frame. You may use any of the values below.
Available options at the sub-hour level are:
01-min
02-min
03-min
04-min
05-min
10-min
15-min
20-min
30-min
45-min
Available options at larger time frames are:
01-hs
02-hs
03-hs
04-hs
06-hs
08-hs
12-hs
24-hs
Slippage
{{site.data.trading_system.slippage}}
In the context of forward testing and live trading sessions, slippage does not affect the actual transactions. However, the parameter is taken into account when creating simulation layers, which are also available during forward testing and live trading.
Slippage is factored both in the session reports and in the graphic representation of each trade provided by the simulation trades product of the trading bot.
Adding a Slippage
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
Configuring the Slippage
Select Configure Slippage on the menu to access the configuration.
{
"positionRate": 0.1,
"stopLoss": 0.2,
"takeProfit": 0.3
}
-
positionRateis the slippage value to be applied to the rate of the take position order, expressed as a percentage (i.e.: 0.1 means 0.1%). -
stopLossis the slippage value to be applied to the rate of the stop order, expressed as a percentage (i.e.: 0.2 means 0.2%). -
takeProfitis the slippage value to be applied to the rate of the take profit order, expressed as a percentage (i.e.: 0.3 means 0.3%).
The number you enter is applied as a percentage of the price of the order and added or subtracted from the price depending on the circumstances, always working against you. For instance, "positionRate": 0.1 means the position will be set at a price 0.1% higher or lower depending on which of the assets in the pair is your base asset.
{% include note.html content="If the slippage parameter is left empty or detached both from your session and your trading system, slippage is not computed during simulations."%}
Fee Structure
{{site.data.trading_system.fee_structure}}
Exchange fees are a crucial part of trading. A strategy may work like a charm when you leave fees out of the equation but would lead you to bankruptcy in a live trading situation.
Fee structures are factored both in the session reports and in the graphic representation of each trade provided by the simulation trades product of the trading bot.
To illustrate how fees affect your bottom line, take a look at the image below.
The trade hits the take profit target above the Position Rate level, however, due to fees, the trade has a negative 0.32% ROI.
In the context of forward testing and live trading sessions, the fee structure assumptions do not affect actual transactions. However, the parameter is taken into account when creating simulation layers, which are also available during forward testing and live trading.
Adding a Fee Structure
To add a parameter that may be missing, select Add Missing Params on the parameters node menu.
Configuring the Fee Structure
Select Configure Fee Structure on the menu to access the configuration.
{
"maker": 0.15,
"taker": 0.25
}
-
makeris the setting for the fee the exchange charges when an order adds liquidity to the market, such as with limit orders. -
takeris the setting for the fee the exchange charges when an order takes liquidity from the market, such as with market or instant orders.
{% include note.html content="Check the fees structure in your exchange, carefully looking into the tier you fall in to feed accurate assumptions to your backtesting and paper trading sessions." %}
{% include note.html content="If the fee structure parameter is left empty or detached both from your session and your trading system, fees are not computed during simulations." %}
{% include important.html content="Remember that, for the time being, and until the new execution engine is released, all orders placed by the trading bot are market orders, thus, the taker fee applies in all cases." %}
Data Storage
{{site.data.network.data_storage}}
Data products generated by the bot instances you run need to be stored somewhere—specifically. The data storage node and its chain of offspring determine that the data is to be stored in the corresponding node.
{% include note.html content="At this point, the only node in which you may store data is your local My Computer node, however, in the future you will be able to store data, or even run bots, on remote machines that you will control from within your local deployment of the system." %}
Adding a Data Storage
To add a data storage, select Add Data Storage on the network node menu.
{% include note.html content="Only one data storage may exist on each network node." %}
Session-based Data
{{site.data.network.session-based_data}}
Adding a Session-based Data Node
To add a session-based data node, select Add Session-based Data on the network node menu.
{% include note.html content="Only one session-based data node may exist on each data storage node." %}
Session Reference
{{site.data.network.session_reference}}
A such, the session reference node must establish a reference with a session. In addition, its offspring nodes determine precisely which data products are stored.
Adding a Session-based Data Node
To add a session reference node, select Add Session Reference on the network node menu.
{% include note.html content="Remember to establish a reference with a session after adding the node." %}
Single Market Data
{{site.data.network.single_market_data}}
The single market data node must establish a reference with a specific market defined in the Crypto Ecosystem hierarchy.
Adding a Single Market Data Node
To add a single market data node, select Add Single Market Data on the network node menu.
{% include note.html content="Remember to establish a reference with a market defined in the Crypto Ecosystem hierarchy after adding the node." %}
Data Product
{{site.data.network.data_product}}
A data product node must reference a product definition in the corresponding data mine.
Adding a Data Product
To add a data product, select Add Data Product on the network node menu.
{% include note.html content="Remember to establish a reference with a product definition of the corresponding bot in the corresponding data mine." %}
Session-independent Data
{{site.data.network.session-independent_data}}
Adding a Session-independent Data Node
To add a session-independent data node, select Add Session-independent Data on the network node menu.
{% include note.html content="Only one session-independent data node may exist on each data storage node." %}
