Files
Superalgos/docs/_includes/trading_system/formula.md
T

111 lines
3.3 KiB
Markdown

<!-- TITLE AND DEFINITION starts -->
{% assign title = "Formula" %}
{% assign definition = site.data.trading_system.formula %}
{% assign preposition = "a" %}
{% assign plural = "s" %}
<!--------------------------------------------- TITLE AND DEFINITION ends -->
{% if include.more == "yes" and include.heading == "more" %}
<details class="detailsCollapsible"><summary class="nobr">Click to learn more about {{ title | downcase }}{{plural}}
</summary>
{% endif %}
{% if include.heading != "" and include.heading != "more" %}
{{include.heading}} {{title}}
{% endif %}
{% if include.icon != "no" %}
{% if include.table == "yes" and include.icon != "no" %}
<table class="definitionTable"><tr><td>
{% endif %}
<img src='images/icons/{{include.icon}}{{ title | downcase | replace: " ", "-" }}.png' />
{% if include.table == "yes" and include.icon != "no" %}
</td><td>
{% endif %}
{% endif %}
{% if include.definition == "bold" %}
<strong>{{ definition }}</strong>
{% else %}
{% if include.definition != "no" %}
{{ definition }}
{% endif %}
{% endif %}
{% if include.table == "yes" and include.icon != "no" %}
</td></tr></table>
{% endif %}
{% if include.more == "yes" and include.content == "more" and include.heading != "more" %}
<details class="detailsCollapsible"><summary class="nobr">Click to learn more about {{ title | downcase }}{{plural}}
</summary>
{% endif %}
{% if include.content != "no" %}
<!--------------------------------------------- CONTENT starts -->
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``` &#8594; 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 <a href='suite-sysntax-overview.html'>internal variables</a>." %}
<!--------------------------------------------- CONTENT ends -->
{% endif %}
{% if include.more == "yes" and include.content != "more" and include.heading != "more" %}
<details class="detailsCollapsible"><summary class="nobr">Click to learn more about {{ title | downcase }}{{plural}}
</summary>
{% endif %}
{% if include.adding != "" %}
{{include.adding}} Adding {{preposition}} {{title}} Node
<!--------------------------------------------- ADDING starts -->
To add a formula, select *Add Formula* on the corresponding parent node menu.
<!-- ADDING ends -->
{% endif %}
{% if include.configuring != "" %}
{{include.configuring}} Configuring the {{title}}
<!-- CONFIGURING starts -->
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<!--------------------------------------------- CONFIGURING ends -->
{% endif %}
{% if include.starting != "" %}
{{include.starting}} Starting {{preposition}} {{title}}
<!--------------------------------------------- STARTING starts -->
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<!--------------------------------------------- STARTING ends -->
{% endif %}
{% if include.more == "yes" %}
</details>
{% endif %}