diff --git a/docs/_data/concepts.md b/docs/_data/concepts.md index 387b3884e..72949b763 100644 --- a/docs/_data/concepts.md +++ b/docs/_data/concepts.md @@ -10,7 +10,7 @@ parent-offspring_relationships: "Nodes in structures of nodes are chained to eac chain: "Nodes in the workspace may be unchained or detached from its parent, carrying all offspring with it. When a node is left unchained, it is no longer taken into account in the logic of the hierarchy, as it no longer belongs to it. When a node is chained back or reattached to the hierarchy, it goes back to being functional." -hierarchy: "A hierarchy is the representation of an overarching, top-level concept resulting in a long chain of nodes, usually with many ramifications. Currently, the system manages four different types of hierarchies: Trading Systems, Data Mines, Network, and Crypto Ecosystem." +hierarchy: "A hierarchy is the representation of an overarching, top-level concept resulting in a long chain of nodes, usually with many ramifications. Currently, the system manages five different types of hierarchies: Charting System, Crypto Ecosystem, Trading Systems, Network, and Data Mines." reference: "A reference is a mechanism by which information in a node is related to, or accessed by, other nodes. The ability of a node to establish a reference with another node enables the first to access the information or features entailed in the second one." @@ -22,4 +22,4 @@ indicator_bot: "An indicator bot processes data to produce more elaborate datase trading_bot: "Based on datasets exposed as products by other bots (counting sensors, indicators and even other trading bots), a trading bot applies the trading logic defined on a trading system to, on one side, generate a complete trading simulation (outputting datasets that include trades, the action of strategies, validation of conditions, etc.), and on the other side, manage the execution of orders when on a forward testing or live trading session." -pending:"balanceAssetA, balanceAssetB, overfitting, supported assets, supported exchanges, supported markets" \ No newline at end of file +pending: "balanceAssetA, balanceAssetB, overfitting, supported assets, supported exchanges, supported markets" \ No newline at end of file diff --git a/docs/_data/concepts.yml b/docs/_data/concepts.yml index 980f72944..72949b763 100644 --- a/docs/_data/concepts.yml +++ b/docs/_data/concepts.yml @@ -10,7 +10,7 @@ parent-offspring_relationships: "Nodes in structures of nodes are chained to eac chain: "Nodes in the workspace may be unchained or detached from its parent, carrying all offspring with it. When a node is left unchained, it is no longer taken into account in the logic of the hierarchy, as it no longer belongs to it. When a node is chained back or reattached to the hierarchy, it goes back to being functional." -hierarchy: "A hierarchy is the representation of an overarching, top-level concept resulting in a long chain of nodes, usually with many ramifications. Currently, the system manages four different types of hierarchies: Trading Systems, Data Mines, Network, and Crypto Ecosystem." +hierarchy: "A hierarchy is the representation of an overarching, top-level concept resulting in a long chain of nodes, usually with many ramifications. Currently, the system manages five different types of hierarchies: Charting System, Crypto Ecosystem, Trading Systems, Network, and Data Mines." reference: "A reference is a mechanism by which information in a node is related to, or accessed by, other nodes. The ability of a node to establish a reference with another node enables the first to access the information or features entailed in the second one." @@ -22,4 +22,4 @@ indicator_bot: "An indicator bot processes data to produce more elaborate datase trading_bot: "Based on datasets exposed as products by other bots (counting sensors, indicators and even other trading bots), a trading bot applies the trading logic defined on a trading system to, on one side, generate a complete trading simulation (outputting datasets that include trades, the action of strategies, validation of conditions, etc.), and on the other side, manage the execution of orders when on a forward testing or live trading session." -pending: "balanceAssetA, balanceAssetB, overfitting" \ No newline at end of file +pending: "balanceAssetA, balanceAssetB, overfitting, supported assets, supported exchanges, supported markets" \ No newline at end of file diff --git a/docs/_data/sidebars/suite_sidebar.yml b/docs/_data/sidebars/suite_sidebar.yml index 0dc0f61cc..e73ce7543 100644 --- a/docs/_data/sidebars/suite_sidebar.yml +++ b/docs/_data/sidebars/suite_sidebar.yml @@ -117,8 +117,16 @@ entries: url: /suite-trading-system-overview.html output: web - - title: Working with strategies - url: /suite-working-with-strategies.html + - title: Strategies + url: /suite-strategies.html + output: web + + - title: Trading Sessions + url: /suite-trading-sessions.html + output: web + + - title: Parameters + url: /suite-parameters.html output: web - title: Conditions & Formulas diff --git a/docs/_data/trading_system.md b/docs/_data/trading_system.md index 68a68d175..379510b2f 100644 --- a/docs/_data/trading_system.md +++ b/docs/_data/trading_system.md @@ -1,4 +1,4 @@ -trading_system: "A trading system is a hierarchy that contains definitions regarding any number of trading strategies, all sharing the same market, the same base asset, and the same initial capital." +trading_system: "A trading system is a framework handling the low-level logic that serves to structure the processes and methods used to implement and deploy trading strategies." parameters: "Parameters are user definitions over several concepts. Parameters defined at the level of a session take precedence over parameters defined at the level of the trading system, which act as a fallback instance. The behavior of parameters may vary depending on the type of session." @@ -44,7 +44,7 @@ initial_take_profit: "The initial take profit defines the initial target to take position_size: "The size of the position is the amount of capital that will go in the trade, denominated in the quoted asset. The position size node allows setting a size for the position using a formula." -position_rate: "The position rate is the rate at which the position is taken, denominated in the quoted asset. The position rate node allows setting the desired position rate with a formula. However, the formula is overridden by the system as execution is currently limited to market orders until a more robust execution system is deployed. Therefore, the position rate is currently taken from the close value of the last candle." +position_rate: "The position rate is the rate at which the position is taken, denominated in the quoted asset. The position rate node allows setting the desired position rate with a formula." open_execution: "Open execution is the node that will eventually hold the information regarding the execution of the trade opening orders." @@ -58,4 +58,6 @@ take_profit: "Take profit node in the manage stage groups all phases managing ta close_stage: "Close stage is not developed yet. In the future, it will deal with the execution of the closing orders, trading log, and related matters." -close_execution: "Close execution is the node that will eventually hold the information regarding the execution of the closing orders." \ No newline at end of file +close_execution: "Close execution is the node that will eventually hold the information regarding the execution of the closing orders." + +event: "An event is an action triggered by predefined market situations." diff --git a/docs/_data/trading_system.yml b/docs/_data/trading_system.yml index 68a68d175..379510b2f 100644 --- a/docs/_data/trading_system.yml +++ b/docs/_data/trading_system.yml @@ -1,4 +1,4 @@ -trading_system: "A trading system is a hierarchy that contains definitions regarding any number of trading strategies, all sharing the same market, the same base asset, and the same initial capital." +trading_system: "A trading system is a framework handling the low-level logic that serves to structure the processes and methods used to implement and deploy trading strategies." parameters: "Parameters are user definitions over several concepts. Parameters defined at the level of a session take precedence over parameters defined at the level of the trading system, which act as a fallback instance. The behavior of parameters may vary depending on the type of session." @@ -44,7 +44,7 @@ initial_take_profit: "The initial take profit defines the initial target to take position_size: "The size of the position is the amount of capital that will go in the trade, denominated in the quoted asset. The position size node allows setting a size for the position using a formula." -position_rate: "The position rate is the rate at which the position is taken, denominated in the quoted asset. The position rate node allows setting the desired position rate with a formula. However, the formula is overridden by the system as execution is currently limited to market orders until a more robust execution system is deployed. Therefore, the position rate is currently taken from the close value of the last candle." +position_rate: "The position rate is the rate at which the position is taken, denominated in the quoted asset. The position rate node allows setting the desired position rate with a formula." open_execution: "Open execution is the node that will eventually hold the information regarding the execution of the trade opening orders." @@ -58,4 +58,6 @@ take_profit: "Take profit node in the manage stage groups all phases managing ta close_stage: "Close stage is not developed yet. In the future, it will deal with the execution of the closing orders, trading log, and related matters." -close_execution: "Close execution is the node that will eventually hold the information regarding the execution of the closing orders." \ No newline at end of file +close_execution: "Close execution is the node that will eventually hold the information regarding the execution of the closing orders." + +event: "An event is an action triggered by predefined market situations." diff --git a/docs/_includes/trading_system/close-stage.md b/docs/_includes/trading_system/close-stage.md new file mode 100644 index 000000000..90f6050fb --- /dev/null +++ b/docs/_includes/trading_system/close-stage.md @@ -0,0 +1,51 @@ + + +{% assign title = "Close Stage" %} +{% assign definition = site.data.trading_system.close_stage %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +As explained earlier while discussing the open stage, the execution functionality is currently under development. Needless to say, execution of the closing orders is of the highest significance, but in the meantime some temporal execution limitations apply. + +Also pending development is the keeping of a formal trading log. The current functionality allows you to see each trade on the screen, along with all the corresponding details, as well as a consolidated report on the live trading panel. This information is stored as a data product, thus, it is not lost. In the future, the system should incorporate a user-friendly feature to browse such logs, and even help analyze them in search for potential optimizations of your trading systems. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a close stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. + +{% include note.html content="Only one close stage may exist in each strategy." %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/condition.md b/docs/_includes/trading_system/condition.md new file mode 100644 index 000000000..d6461e7b0 --- /dev/null +++ b/docs/_includes/trading_system/condition.md @@ -0,0 +1,59 @@ + + +{% assign title = "Condition" %} +{% assign definition = site.data.trading_system.condition %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +Therefore, conditions are used to mathematically describe what needs to happen with the market for a certain action to be taken. + +**For example:** + +**Situation 1** + +* Condition A: ```chart.at01hs.candle.close > chart.at01hs.bollingerBand.MovingAverage``` → This means that the latest candle at the 1 hour chart closed above the Bollinger Bands moving average. + +* Condition B: ```chart.at01hs.candle.previous.max > chart.at01hs.bollingerBand.previous.MovingAverage``` → This means that the maximum value of the candle before the last one, was higher than the Bollinger Bands moving average. + +In the example above, conditions A and B are comparison statements that may evaluate either _true_ or _false_. In the case both would evaluate _true_ then Situation 1 would be true as well. + +{% include note.html content="To learn how to write conditions, start with the Syntax Overview." %} + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a condition, select *Add Condition* on the corresponding situation node menu. A condition with its JavaScript code node is added. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/formula.md b/docs/_includes/trading_system/formula.md new file mode 100644 index 000000000..95b03a131 --- /dev/null +++ b/docs/_includes/trading_system/formula.md @@ -0,0 +1,55 @@ + + +{% assign title = "Formula" %} +{% assign definition = site.data.trading_system.formula %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +In the context of a trading system, formulas are used to determine the values for stopLoss, takeProfit, positionRate and positionSize. + +Formulas may use [internal variables](suite-internal-variables.html) made available by the system. In addition to the ones listed above, other variables such as balanceAssetA and balanceAssetB may be of use. + +**For example:** + +* ```positionRate - positionRate * 2.5 / 100``` → This formula may be used to define an initial stop target 2.5% below the rate at which the position was taken. + +{% include note.html content="To learn which variables may be used in formulas, see the page about internal variables." %} + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a formula, select *Add Formula* on the corresponding parent node menu. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/initial-stop.md b/docs/_includes/trading_system/initial-stop.md new file mode 100644 index 000000000..6d11aaa16 --- /dev/null +++ b/docs/_includes/trading_system/initial-stop.md @@ -0,0 +1,53 @@ + + +{% assign title = "Initial Stop" %} +{% assign definition = site.data.trading_system.initial_stop %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +Notice that the setting of the stop target has no relation to the execution of orders. The stop is a target, not an order to be placed. That is, the system does not place stop orders. + +This is a design feature that allows you to keep your cards, not allowing anyone to anticipate what your strategy may be, not even the exchange. It is a known fact that some exchanges may attempt or allow to front-run stop orders. + +Instead, the trading bot instance monitors the market, and only once the stop target has been hit does it place the corresponding order to close the trade. + +The initial target is set in phase 0, that is, the departing point for the management of the trade to be handled in the manage stage. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add an initial stop node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/initial-take-profit.md b/docs/_includes/trading_system/initial-take-profit.md new file mode 100644 index 000000000..58468a5f9 --- /dev/null +++ b/docs/_includes/trading_system/initial-take-profit.md @@ -0,0 +1,49 @@ + + +{% assign title = "Initial Take Profit" %} +{% assign definition = site.data.trading_system.initial_take_profit %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +Pretty much like with the initial stop, the initial take profit is a target, and not an order to be placed. Only when the trading bot instance detects that the target has been hit does it place an order to close the trade. + +The initial target is set in phase 0, which may shift to the following phase once the corresponding next phase event is validated. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add an initial take-profit node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/manage-stage.md b/docs/_includes/trading_system/manage-stage.md new file mode 100644 index 000000000..45d0e829a --- /dev/null +++ b/docs/_includes/trading_system/manage-stage.md @@ -0,0 +1,61 @@ + + +{% assign title = "Manage Stage" %} +{% assign definition = site.data.trading_system.manage_stage %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +The management of a trade aims to increase the efficiency of your trading system. Conceptually, a trade is not an instant event, but an event which has an opening, a period of maturation, and a closing. The management of the trade happens in that period of maturation. + +The concept of managing the trade means that the formulas to determine the take profit and stop may change as the trade develops. The typical situation in which you may want to change your original take profit and stop formulas is when the trade seems to be going well in your favor. + +It may be in your best interest to manage both stop and take-profit targets, moving them in the direction of the trade as the market moves, allowing some leeway for a larger profit than expected and, at the same time, cutting the potential for losses. + +The management of the trade is handled in phases. Actually, the management of take profit and stop—while correlated—is done independently of each other, therefore, each concept has its own set of phases. + +When a situation defined by a set of conditions is met, the next phase event indicates that the take profit or stop formulas shall be changed. At the moment those predefined conditions are met, you enter the next phase. Keep in mind that the trade is in constant development, so there may be as many phases as you deem appropriate for your particular strategy. + +The idea of having different phases comes from the notion that big market moves tend to provide clues as to what may come up next. For instance, rallies may accelerate as more traders join the move. Recognizable patterns may emerge. Signs of exhaustion may be identified. + +All of these considerations should feed the dynamic analysis performed as the trade develops, and may be contrasted with the predefined conditions that may push take profit or stop further, entering one phase after the next. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a manage stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. + +{% include note.html content="Only one manage stage may exist in each strategy." %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/open-stage.md b/docs/_includes/trading_system/open-stage.md new file mode 100644 index 000000000..82178b819 --- /dev/null +++ b/docs/_includes/trading_system/open-stage.md @@ -0,0 +1,53 @@ + + +{% assign title = "Open Stage" %} +{% assign definition = site.data.trading_system.open_stage %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +Conceptually, the open stage deals with the details that concern the opening of a trade once the decision to take a position has been made. In this stage, you deal with the aforementioned parameters, each of which is defined by a formula. + +Ideally, the open stage would also handle the parameters that define the execution of the trade, that is, how and which kinds of orders are to be placed, on which exchanges and so on. However, the execution side of the system is still under development. For the time being, execution is drastically simplified: a single market order is placed for each order. + +{% include note.html content="Learn more about the temporal execution limitations." %} + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add an open stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. + +{% include note.html content="Only one open stage may exist in each strategy." %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/position-rate.md b/docs/_includes/trading_system/position-rate.md new file mode 100644 index 000000000..afe701a6d --- /dev/null +++ b/docs/_includes/trading_system/position-rate.md @@ -0,0 +1,47 @@ + + +{% assign title = "Position Rate" %} +{% assign definition = site.data.trading_system.position_rate %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +However, for the time being, the formula is overridden by the system as execution is currently limited to market orders until a more robust execution system is deployed. Therefore, the position rate is currently taken from the closing value of the last candle. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a position rate node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/position-size.md b/docs/_includes/trading_system/position-size.md new file mode 100644 index 000000000..8abd8918c --- /dev/null +++ b/docs/_includes/trading_system/position-size.md @@ -0,0 +1,47 @@ + + +{% assign title = "Position Size" %} +{% assign definition = site.data.trading_system.position_size %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + + + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a position size node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/situation.md b/docs/_includes/trading_system/situation.md new file mode 100644 index 000000000..1fb75a57f --- /dev/null +++ b/docs/_includes/trading_system/situation.md @@ -0,0 +1,51 @@ + + +{% assign title = "Situation" %} +{% assign definition = site.data.trading_system.situation %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +In other words, you define situations in which you wish a certain event to happen (*i.e.:* trigger on the strategy, take a position, etc.) and each situation is described as a set of conditions that need to be met for the event to be triggered. + +A situation gets validated when all conditions under it are true. + +An event may have more than one situation attached to it. In such a case, when any of the situations gets validated, it triggers the event. That is, events may be triggered in different circumstances, meaning that you are free to define different situations upon which the same event would be triggered. In such a case, when any of the situations evaluate true, then the event is triggered. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a situation, select *Add Situation* on the corresponding event node menu. A situation is added along with a condition and JavaScript code node. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/strategy.md b/docs/_includes/trading_system/strategy.md new file mode 100644 index 000000000..c9ab71846 --- /dev/null +++ b/docs/_includes/trading_system/strategy.md @@ -0,0 +1,70 @@ + + +{% assign title = "Strategy" %} +{% assign definition = site.data.trading_system.strategy %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +The definition of a strategy may be analyzed in three sections. + +**"A strategy is a set of actions occurring in stages"** + +Strategies are defined in the following steps: + +* Trigger Stage +* Open Stage +* Manage Stage +* Close Stage + +These stages are played in a sequence: once a strategy is *triggered* it looks to *open* a position; once a position is open, it is time to *manage* it as the trade develops; and once a stop or take profit target is hit, it is time to *close* the position. + +**"designed to achieve a specific goal within a broader plan"** + +Your investment plan or trading carrer may have any number of goals (*e.g.: accumulating bitcoin, diversifying on a basket of coins, annual profit targets, etc.*). If you attempt to achieve two different goals with a single strategy, you may run into problems. It may be doable, but the strategy would certainly be more complex. In any case, the logical thing to do is to analyze each goal separately so that you can design at least one clear, straightforward strategy for each goal. + +**"via executing trades"** + +The definition of strategy points to the concept of *a trade*. A trade is a process that exchanges the base asset for the quoted asset and that—after some time, as the trade develops and targets are hit—exchanges back the quoted asset for the base asset. The first and foremost rule of a trade is to preserve capital and its main goal is to increase it. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a strategy, select *Add Strategy* on the trading system node menu. The strategy node is created along with the rest of the basic structure of nodes required to define each of the strategy stages and their events. + +{% include tip.html content="You may work with as many strategies as you wish. " %} + +{% include important.html content="Strategies within the same trading system work in the same market, have the same base asset, and —most importantly—share the same capital. This means that only one strategy in the trading system may be triggered at any one point and that no other strategy in the trading system may be triggered until the first one is triggered off. If you wish to have more than one strategy trading at the same time, then those strategies must be put in separate trading systems. " %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/take-position-event.md b/docs/_includes/trading_system/take-position-event.md new file mode 100644 index 000000000..117cf3f6e --- /dev/null +++ b/docs/_includes/trading_system/take-position-event.md @@ -0,0 +1,51 @@ + + +{% assign title = "Take Position Event" %} +{% assign definition = site.data.trading_system.take_position_event %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +The trigger-on event merely selects a strategy to be considered for trading under the current market situation. The actual decision to enter a position may require more specific conditions to be met. For that reason, the take position event is a separate entity from the trigger-on event. + +Therefore, the take position event is defined with its own set of situations and conditions. + +Once the take position event is triggered, the decision to take a position has been made and there is nothing else to consider in that regard. Therefore, the system shifts from the trigger stage to the open stage. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a take position event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/trading-system.md b/docs/_includes/trading_system/trading-system.md new file mode 100644 index 000000000..ad7f4a5fe --- /dev/null +++ b/docs/_includes/trading_system/trading-system.md @@ -0,0 +1,53 @@ + + +{% assign title = "Trading System" %} +{% assign definition = site.data.trading_system.trading_system %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +In practical terms, a trading system is a hierarchical arrangement organizing the actionable aspects of your investment plan. The hierarchy contains definitions regarding any number of trading strategies, all sharing the same market, the same base asset, and the same initial capital. + +You use a trading system to define strategies following the trading framework implemented by the Superalgos Protocol, splitting strategies into four stages: trigger, open, manage, and close. + +The concept of describing strategies in phases is fundamental to the methodical aspect of the trading system, as it provides a framework to run every strategy with the same logic, which contributes to developing scalable trading systems that may grow to any number of strategies. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a trading system, select *Add Trading System* on the workspace node menu. + +{% include tip.html content="You may work with as many trading systems as you wish" %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/trigger-off-event.md b/docs/_includes/trading_system/trigger-off-event.md new file mode 100644 index 000000000..ad7f60388 --- /dev/null +++ b/docs/_includes/trading_system/trigger-off-event.md @@ -0,0 +1,51 @@ + + +{% assign title = "Trigger-Off Event" %} +{% assign definition = site.data.trading_system.trigger-off_event %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +In conceptual terms, the trigger-off event is the mechanism you use to define the situation in which the corresponding strategy should stop considering the trading opportunity signaled by the trigger-on event. That is, you use the trigger off event to describe the scenario for the invalidation of the trading idea behind the strategy. + +Once a strategy is triggered-on, only two possible scenarios may follow. Either the take position event is triggered, thus, taking a position and opening a trade, or the trigger-off event is triggered first. + +In the first scenario, the strategy remains *on* until the trade is closed. As the trade is closed, the strategy is triggered-off. In the second scenario, the strategy is triggered-off immediately. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a trigger-off event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/trigger-on-event.md b/docs/_includes/trading_system/trigger-on-event.md new file mode 100644 index 000000000..ac2c3904f --- /dev/null +++ b/docs/_includes/trading_system/trigger-on-event.md @@ -0,0 +1,49 @@ + + +{% assign title = "Trigger-On Event" %} +{% assign definition = site.data.trading_system.trigger-on_event %} +{% assign preposition = "the" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +In conceptual terms, the trigger-on event is the mechanism you use to define the specific situations in which you would consider trading with the corresponding strategy. Think of the trigger-on event as the definition of the scenario in which the trading idea behind the strategy should be carefully considered. + +Once a strategy is triggered-on, the system starts evaluating the take position event. In conceptual terms, it means that the system has been alerted that the trading idea behind the corresponding trading strategy has produced a signal and that it should carefully monitor the market for the opportunity of taking a position. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a trigger-on event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/_includes/trading_system/trigger-stage.md b/docs/_includes/trading_system/trigger-stage.md new file mode 100644 index 000000000..6e96e58cc --- /dev/null +++ b/docs/_includes/trading_system/trigger-stage.md @@ -0,0 +1,57 @@ + + +{% assign title = "Trigger Stage" %} +{% assign definition = site.data.trading_system.trigger_stage %} +{% assign preposition = "a" %} + + + +{% if include.heading != "" %} +{{include.heading}} {{title}} +{% endif %} + +{% if include.icon != "no" %} + +{% endif %} + +**{{ definition }}** + + + +A trading system may have multiple strategies designed for the same market, with the same base asset. + +An important aspect of trading systems is that they are allocated a certain amount of capital (see the base asset parameter). As a consequence, strategies within a trading system have to share that capital allocation. + +The logic behind the concept of the trigger stage assumes that different strategies within a trading system are specialized for trading in different market conditions. The trigger stage in each strategy is, therefore, the mechanism by which any particular strategy may be selected to trade, given any particular market situation. + +The triggering-on of a strategy effectively blocks the selection of any other strategy in the trading system, and reserves the whole capital allocation for a potential trade, until the strategy is triggered-off. + +As a corollary, if certain strategies are meant to trade under the same market situations and open trades concurrently, then those strategies should be put in separate trading systems. + + + +{% if include.adding != "" %} + +{{include.adding}} Adding {{preposition}} {{title}} + + + +To add a trigger stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. + +{% include note.html content="Only one trigger stage may exist in each strategy." %} + + + +{% endif %} + +{% if include.configuring != "" %} + +{{include.configuring}} Configuring the {{title}} + + + +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + + +{% endif %} \ No newline at end of file diff --git a/docs/pages/suite/suite-hierarchies.md b/docs/pages/suite/suite-hierarchies.md index 6b168598e..8780e2a5c 100644 --- a/docs/pages/suite/suite-hierarchies.md +++ b/docs/pages/suite/suite-hierarchies.md @@ -1,6 +1,6 @@ --- title: "Hierarchies" -summary: "There are four different types of hierarchies: Trading Systems, Data Mines, Network, and Crypto Ecosystem." +summary: "There are five different types of hierarchies: Charting System, Crypto Ecosystem, Trading Systems, Network, and Data Mines." sidebar: suite_sidebar permalink: suite-hierarchies.html --- @@ -15,20 +15,18 @@ IMAGE {{site.data.charting_system.charting_system}} +## Crypto Ecosystem + +{{site.data.crypto_ecosystem.crypto_ecosystem}} + ## Trading System {{site.data.trading_system.trading_system}} -## Data Mine - -{{site.data.data_mine.data_mine}} - ## Network {{site.data.network.network}} -## Crypto Ecosystem - -{{site.data.crypto_ecosystem.crypto_ecosystem}} - +## Data Mine +{{site.data.data_mine.data_mine}} diff --git a/docs/pages/suite/suite-parameters.md b/docs/pages/suite/suite-parameters.md new file mode 100644 index 000000000..ec27269db --- /dev/null +++ b/docs/pages/suite/suite-parameters.md @@ -0,0 +1,20 @@ +--- +title: Parameters +summary: "Strategies are defined in a sequence of stages." +sidebar: suite_sidebar +permalink: suite-parameters.html +--- + +{% include /trading_system/parameters.md heading="" icon="150-" adding="" configuring="" %} + +{% include /trading_system/base-asset.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/quoted-asset.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/time-frame.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/time-range.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/slippage.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/fee-structure.md heading="##" icon="150-" adding="" configuring="" %} \ No newline at end of file diff --git a/docs/pages/suite/suite-strategies.md b/docs/pages/suite/suite-strategies.md new file mode 100644 index 000000000..354c1e5eb --- /dev/null +++ b/docs/pages/suite/suite-strategies.md @@ -0,0 +1,30 @@ +--- +title: Strategies +summary: "Strategies are defined as a sequence of stages." +sidebar: suite_sidebar +permalink: suite-strategies.html +--- + +{% include /trading_system/strategy.md heading="" icon="150-" adding="" configuring="" %} + +{% include /trading_system/trigger-stage.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/trigger-on-event.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/trigger-off-event.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/take-position-event.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/open-stage.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/initial-stop.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/initial-take-profit.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/position-size.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/position-rate.md heading="###" icon="no" adding="" configuring="" %} + +{% include /trading_system/manage-stage.md heading="##" icon="150-" adding="" configuring="" %} + +{% include /trading_system/close-stage.md heading="##" icon="150-" adding="" configuring="" %} \ No newline at end of file diff --git a/docs/pages/suite/suite-trading-sessions.md b/docs/pages/suite/suite-trading-sessions.md new file mode 100644 index 000000000..cd092bcfa --- /dev/null +++ b/docs/pages/suite/suite-trading-sessions.md @@ -0,0 +1,7 @@ +--- +title: Trading Sessions +summary: "Strategies are defined in a sequence of stages." +sidebar: suite_sidebar +permalink: suite-trading-sessions.html +--- + diff --git a/docs/pages/suite/suite-trading-system-hierarchy.md b/docs/pages/suite/suite-trading-system-hierarchy.md index b023b5188..4370e354c 100644 --- a/docs/pages/suite/suite-trading-system-hierarchy.md +++ b/docs/pages/suite/suite-trading-system-hierarchy.md @@ -955,27 +955,7 @@ toc: false -## Trading System - - - -**{{site.data.trading_system.trading_system}}** - -Think of a trading system as a framework; the low-level logic that serves to structure the processes and methods that you will use to implement your trading strategies. In practical terms, a trading system is a hierarchical arrangement organizing the actionable aspects of your investment plan. - -Therefore, you will use this hierarchy to define strategies, following the trading framework implemented by the Superalgos Protocol, splitting strategies into four stages: trigger, open, manage and close. - -These stages are played in a sequence. Once a strategy is *triggered* it will look to *open* a position. Once a position is open, it is time to *manage* it as the trade develops. And once a stop or take profit target is hit, it is time to *close* the position. - -### Adding a Trading System - -To add a trading system, select *Add Trading System* on the workspace node menu. - -{% include tip.html content="You may work with as many trading systems as you wish" %} - - - - +{% include /trading_system/trading-system.md heading="##" icon="150-" adding="###" configuring="" %} {% include /trading_system/parameters.md heading="##" icon="150-" adding="###" configuring="" %} @@ -991,180 +971,21 @@ To add a trading system, select *Add Trading System* on the workspace node menu. {% include /trading_system/fee-structure.md heading="##" icon="150-" adding="###" configuring="###" %} +{% include /trading_system/strategy.md heading="##" icon="150-" adding="###" configuring="" %} +{% include /trading_system/trigger-stage.md heading="##" icon="150-" adding="###" configuring="" %} +{% include /trading_system/trigger-on-event.md heading="##" icon="150-" adding="###" configuring="" %} +{% include /trading_system/situation.md heading="##" icon="150-" adding="###" configuring="" %} -## Strategy +{% include /trading_system/condition.md heading="##" icon="150-" adding="###" configuring="" %} - +{% include /trading_system/trigger-off-event.md heading="##" icon="150-" adding="###" configuring="" %} -**{{site.data.trading_system.strategy}}** +{% include /trading_system/take-position-event.md heading="##" icon="150-" adding="###" configuring="" %} -The concept of describing strategies in phases is fundamental to the methodical aspect of the trading system, as it provides a framework to run every strategy with the same logic, which contributes to developing scalable trading systems that may grow to any number of strategies. - -The definition of strategy points to the concept of *a trade*. A trade is a process that exchanges the base asset for the quoted asset and that—after some time, as the trade develops and targets are hit—exchanges back the quoted asset for the base asset. The first and foremost rule of a trade is to preserve capital and its main goal is to increase it. - - - - -### Adding a Strategy - -To add a strategy, select *Add Strategy* on the trading system node menu. The strategy node is created along with the rest of the basic structure of nodes required to define each of the strategy stages and their events. - -{% include tip.html content="You may work with as many strategies as you wish. " %} - -{% include important.html content="Strategies within the same trading system work in the same market, have the same base asset, and —most importantly—share the same capital. This means that only one strategy in the trading system may be triggered at any one point and that no other strategy in the trading system may be triggered until the first one is triggered off. If you wish to have more than one strategy trading at the same time, then those strategies must be put in separate trading systems. " %} - - - - - -## Trigger Stage - - - -**{{site.data.trading_system.trigger_stage}}** - -A trading system may have multiple strategies designed for the same market, with the same base asset. - -An important aspect of trading systems is that they are allocated a certain amount of capital (see the base asset parameter). As a consequence, strategies within a trading system have to share that capital allocation. - -The logic behind the concept of the trigger stage assumes that different strategies within a trading system are specialized for trading in different market conditions. The trigger stage in each strategy is, therefore, the mechanism by which any particular strategy may be selected to trade, given any particular market situation. - -The triggering-on of a strategy effectively blocks the selection of any other strategy in the trading system, and reserves the whole capital allocation for a potential trade, until the strategy is triggered-off. - -As a corollary, if certain strategies are meant to trade under the same market situations and open trades concurrently, then those strategies should be put in separate trading systems. - -### Adding a Trigger Stage - -To add a trigger stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. - - - - - -## Trigger-On Event - - - -**{{site.data.trading_system.trigger-on_event}}** - -In conceptual terms, the trigger-on event is the mechanism you use to define the specific situations in which you would consider trading with the corresponding strategy. Think of the trigger-on event as the definition of the scenario in which the trading idea behind the strategy should be carefully considered. - -Once a strategy is triggered-on, the system starts evaluating the take position event. In conceptual terms, it means that the system has been alerted that the trading idea behind the corresponding trading strategy has produced a signal and that it should carefully monitor the market for the opportunity of taking a position. - -### Adding a Trigger-On Event - -To add a trigger-on event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. - - - - -## Situation - - - -**{{site.data.trading_system.situation}}** - -In other words, you define situations in which you wish a certain event to happen (*i.e.:* trigger on the strategy, take a position, etc.) and each situation is described as a set of conditions that need to be met for the event to be triggered. - -A situation gets validated when all conditions under it are true. - -An event may have more than one situation attached to it. In such a case, when any of the situations gets validated, it triggers the event. That is, events may be triggered in different circumstances, meaning that you are free to define different situations upon which the same event would be triggered. In such a case, when any of the situations evaluate true, then the event is triggered. - -### Adding a Situation - -To add a situation, select *Add Situation* on the corresponding event node menu. A situation is added along with a condition and JavaScript code node. - - - - - -## Condition - - - -**{{site.data.trading_system.condition}}** - -Therefore, conditions are used to mathematically describe what needs to happen with the market for a certain action to be taken. - -**For example:** - -**Situation 1** - -* Condition A: ```chart.at01hs.candle.close > chart.at01hs.bollingerBand.MovingAverage``` → This means that the latest candle at the 1 hour chart closed above the Bollinger Bands moving average. - -* Condition B: ```chart.at01hs.candle.previous.max > chart.at01hs.bollingerBand.previous.MovingAverage``` → This means that the maximum value of the candle before the last one, was higher than the Bollinger Bands moving average. - -In the example above, conditions A and B are comparison statements that may evaluate either _true_ or _false_. In the case both would evaluate _true_ then Situation 1 would be true as well. - -{% include note.html content="To learn how to write conditions, start with the Syntax Overview." %} - -### Adding a Condition - -To add a condition, select *Add Condition* on the corresponding situation node menu. A condition with its JavaScript code node is added. - - - - - -## Trigger-Off Event - - - -**{{site.data.trading_system.trigger-off_event}}** - -In conceptual terms, the trigger-off event is the mechanism you use to define the situation in which the corresponding strategy should stop considering the trading opportunity signaled by the trigger-on event. That is, you use the trigger off event to describe the scenario for the invalidation of the trading idea behind the strategy. - -Once a strategy is triggered-on, only two possible scenarios may follow. Either the take position event is triggered, thus, taking a position and opening a trade, or the trigger-off event is triggered first. - -In the first scenario, the strategy remains *on* until the trade is closed. As the trade is closed, the strategy is triggered-off. In the second scenario, the strategy is triggered-off immediately. - -### Adding a Trigger-Off Event - -To add a trigger-off event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. - - - - - - -## Take Position Event - - - -{{site.data.trading_system.take_position_event}} - -The trigger-on event merely selects a strategy to be considered for trading under the current market situation. The actual decision to enter a position may require more specific conditions to be met. For that reason, the take position event is a separate entity from the trigger-on event. - -Therefore, the take position event is defined with its own set of situations and conditions. - -Once the take position event is triggered, the decision to take a position has been made and there is nothing else to consider in that regard. Therefore, the system shifts from the trigger stage to the open stage. - -### Adding a Take Position Event - -To add a take position event node, select *Add Missing Events* on the trigger stage node menu. All events that may be missing are created along with the rest of the basic structure of nodes required to define each of them. - - - - - -## Open Stage - - - -**{{site.data.trading_system.open_stage}}** - -Conceptually, the open stage deals with the details that concern the opening of a trade once the decision to take a position has been made. In this stage, you deal with the aforementioned parameters, each of which is defined by a formula. - -Ideally, the open stage would also handle the parameters that define the execution of the trade, that is, how and which kinds of orders are to be placed, on which exchanges and so on. However, the execution side of the system is still under development. For the time being, execution is drastically simplified: a single market order is placed for each order. - -{% include note.html content="Learn more about the temporal execution limitations." %} - -### Adding an Open Stage - -To add an open stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. +{% include /trading_system/open-stage.md heading="##" icon="150-" adding="###" configuring="" %} @@ -1183,23 +1004,9 @@ To add an initial definition node, select *Add Initial Definition* on the open s -## Initial Stop +{% include /trading_system/initial-stop.md heading="##" icon="150-" adding="###" configuring="" %} - -**{{site.data.trading_system.initial_stop}}** - -Notice that the setting of the stop target has no relation to the execution of orders. The stop is a target, not an order to be placed. That is, the system does not place stop orders. - -This is a design feature that allows you to keep your cards, not allowing anyone to anticipate what your strategy may be, not even the exchange. It is a known fact that some exchanges may attempt or allow to front-run stop orders. - -Instead, the trading bot instance monitors the market, and only once the stop target has been hit does it place the corresponding order to close the trade. - -The initial target is set in phase 0, that is, the departing point for the management of the trade to be handled in the manage stage. - -### Adding an Initial Stop - -To add an initial stop node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. @@ -1219,25 +1026,11 @@ To add the phase 0 node, select *Add Phase* on the initial definitions node menu -## Formula - -**{{site.data.trading_system.formula}}** +{% include /trading_system/formula.md heading="##" icon="150-" adding="###" configuring="" %} -In the context of a trading system, formulas are used to determine the values for stopLoss, takeProfit, positionRate and positionSize. -Formulas may use [internal variables](suite-internal-variables.html) made available by the system. In addition to the ones listed above, other variables such as balanceAssetA and balanceAssetB may be of use. - -**For example:** - -* ```positionRate - positionRate * 2.5 / 100``` → This formula may be used to define an initial stop target 2.5% below the rate at which the position was taken. - -{% include note.html content="To learn which variables may be used in formulas, see the page about internal variables." %} - -### Adding a Formula - -To add a formula, select *Add Formula* on the corresponding parent node menu. @@ -1259,51 +1052,17 @@ To add a next phase event, select *Add Next Phase Event* on the corresponding ph -## Initial Take Profit - +{% include /trading_system/initial-take-profit.md heading="##" icon="150-" adding="###" configuring="" %} -**{{site.data.trading_system.initial_take_profit}}** +{% include /trading_system/position-size.md heading="##" icon="150-" adding="###" configuring="" %} -Pretty much like with the initial stop, the initial take profit is a target, and not an order to be placed. Only when the trading bot instance detects that the target has been hit does it place an order to close the trade. - -The initial target is set in phase 0, which may shift to the following phase once the corresponding next phase event is validated. - -### Adding an Initial Take Profit - -To add an initial take-profit node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. +{% include /trading_system/position-rate.md heading="##" icon="150-" adding="###" configuring="" %} -## Position Size - - - -**{{site.data.trading_system.position_size}}** - -### Adding a Position Size - -To add a position size node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. - - - - - - -## Position Rate - - - -**{{site.data.trading_system.position_rate}}** - -### Adding a Position Rate - -To add a position rate node, select *Add Missing Items* on the initial definitions node menu. All items that may be missing are created along with the rest of the basic structure of nodes required to define each of them. - - - @@ -1323,29 +1082,9 @@ To add an open execution node, select *Add Open Execution* on the open stage nod -## Manage Stage +{% include /trading_system/manage-stage.md heading="##" icon="150-" adding="###" configuring="" %} - -**{{site.data.trading_system.manage_stage}}** - -The management of a trade aims to increase the efficiency of your trading system. Conceptually, a trade is not an instant event, but an event which has an opening, a period of maturation, and a closing. The management of the trade happens in that period of maturation. - -The concept of managing the trade means that the formulas to determine the take profit and stop may change as the trade develops. The typical situation in which you may want to change your original take profit and stop formulas is when the trade seems to be going well in your favor. - -It may be in your best interest to manage both stop and take-profit targets, moving them in the direction of the trade as the market moves, allowing some leeway for a larger profit than expected and, at the same time, cutting the potential for losses. - -The management of the trade is handled in phases. Actually, the management of take profit and stop—while correlated—is done independently of each other, therefore, each concept has its own set of phases. - -When a situation defined by a set of conditions is met, the next phase event indicates that the take profit or stop formulas shall be changed. At the moment those predefined conditions are met, you enter the next phase. Keep in mind that the trade is in constant development, so there may be as many phases as you deem appropriate for your particular strategy. - -The idea of having different phases comes from the notion that big market moves tend to provide clues as to what may come up next. For instance, rallies may accelerate as more traders join the move. Recognizable patterns may emerge. Signs of exhaustion may be identified. - -All of these considerations should feed the dynamic analysis performed as the trade develops, and may be contrasted with the predefined conditions that may push take profit or stop further, entering one phase after the next. - -### Adding a Manage Stage - -To add a manage stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. @@ -1401,19 +1140,9 @@ To add a take profit node, select *Add Missing Items* on the manage stage node m -## Close Stage +{% include /trading_system/close-stage.md heading="##" icon="150-" adding="###" configuring="" %} - -**{{site.data.trading_system.close_stage}}** - -As explained earlier while discussing the open stage, the execution functionality is currently under development. Needless to say, execution of the closing orders is of the highest significance, but in the meantime some temporal execution limitations apply. - -Also pending development is the keeping of a formal trading log. The current functionality allows you to see each trade on the screen, along with all the corresponding details, as well as a consolidated report on the live trading panel. This information is stored as a data product, thus, it is not lost. In the future, the system should incorporate a user-friendly feature to browse such logs, and even help analyze them in search for potential optimizations of your trading systems. - -### Adding a Close Stage - -To add a close stage node, select *Add Missing Stages* on the strategy node menu. All stages that may be missing are created along with the rest of the basic structure of nodes required to define each of them and their events. diff --git a/docs/pages/suite/suite-trading-system-overview.md b/docs/pages/suite/suite-trading-system-overview.md index c5f093b28..8ac81021a 100644 --- a/docs/pages/suite/suite-trading-system-overview.md +++ b/docs/pages/suite/suite-trading-system-overview.md @@ -1,54 +1,10 @@ --- -title: Overview -summary: "" +title: Trading System +summary: "A trading system is a device that allows building strategies in a standardized manner." sidebar: suite_sidebar permalink: suite-trading-system-overview.html --- -| Definition | Trading System | -| :---: | :---: | -| ![definition](https://user-images.githubusercontent.com/13994516/70050815-236dca00-15d0-11ea-9c8d-304edd640c8d.png) | ![trading-system](https://user-images.githubusercontent.com/13994516/70053113-07205c00-15d5-11ea-9618-819cf2e5a0e9.png) | +{% include /trading_system/trading-system.md heading="" icon="150-" adding="" configuring="" %} -A *trading system* is a collection of strategies that conform to certain *parameters*. - -The trading system organizes the workflow to build strategies following the framework implemented by the _Superalgos Trading Protocol_. If you are not familiar with the protocol, please read either of the following articles: - -* [Superalgos Trading Protocol V0.1 - the Short Version, for Experienced Traders](https://medium.com/superalgos/superalgos-protocol-v0-1-the-short-version-for-experienced-traders-86c3fa43f1c0). - -* [Superalgos Trading Protocol V0.1 - the Long Version, for Beginner Traders](https://medium.com/superalgos/superalgos-protocol-v0-1-the-long-version-for-beginner-traders-f293f1cc6c13). - -> **NOTE**: The articles above are instrumental in understanding the framework that will guide you through the process of creating strategies. The framework is not explained in this guide, therefore, we recommend you go through the article before starting work on your own strategies. - -## Parameters - -Parameters are both a property of the trading system and of the testing and live trading sessions that engage with the trading system. - -Precedence lies with the parameters defined at the level of the sessions. The platform implements a fallback mechanism by which, in case a certain parameter is not found at the level of the session, the information is retrieved from the trading system. - -The one parameter that needs to be defined early on is the *base asset*, that is, the side of the market you wish to stand on when you are out of the trade, with no open positions. We will review the rest of the trading system parameters later on when discussing testing and live trading sessions. - -| Parameters | Base Asset | -| :---: | :---: | -| ![parameters](https://user-images.githubusercontent.com/13994516/63508921-3f46d780-c4db-11e9-970d-8d5e2ca5ebe3.png) | ![base-asset](https://user-images.githubusercontent.com/13994516/63638431-0d26a880-c688-11e9-84f9-fa1fe5acbdbf.png) | - -Your Base Asset formula contains the following piece of code, which you may configure to your own needs: - -``` -{ -"name": "USDT", -"initialBalance": 10, -"minimumBalance": 1, -"maximumBalance": 20000 -} -``` - -| Variable | Description / Possible Values | -| --- | --- | -| name | USDT or BTC | -| initialBalance | The amount of capital you wish to allocate to the whole trading system. | -| minimumBalance | When your overall balance combined (balanceAssetA + balanceAssetB) reaches this value, all trading stops; think of this a general safety switch. | -| maximumBalance | A similar concept as the minimumBalance, but on the higher side of the _initialBalance_. | - -> **NOTE**: All strategies contained within a trading system share these parameters. In other words, all strategies within the same trading system have the same base asset and share the initial balance. - -Only one trading system is allowed at a time per each definition. If you wish to have more than one trading system, then you will create a new definition to hold the new trading system. This means that if you wish to have strategies with different base assets, you will need to create them within different trading systems, which will live in different definitions. +{% include note.html content="Check the Hierarchies Directory for a thorough description of the whole trading system hierarchy." %} \ No newline at end of file