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

115 lines
3.5 KiB
Markdown

<!-- TITLE AND DEFINITION starts -->
{% assign title = "Condition" %}
{% assign definition = site.data.trading_system.condition %}
{% 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 -->
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``` &#8594; 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``` &#8594; 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 <a href='suite-sysntax-overview.html'>Syntax Overview</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 condition, select *Add Condition* on the corresponding situation node menu. A condition with its JavaScript code node is added.
<!-- 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 %}