The EA's modular system

Modules are the building blocks of your EA and are defined under the Trading Strategy part of the system. The modules are divided into 3 categories:

Modules for opening

Modules for opening take input from Signals and Modules which prevent opening modules and open, or close, orders as a result. There are currently two modules for opening:

Single order

The Single order - Open module, will only allow one order/ position to be opened at the same time. It will only open a new order after the current one is closed.

Settings

It doesn't have settings, which means it will abide to the Signals and the input from the Prevent open modules.

Behaviour

When an Open Signal is active it will try to open an order or position, unless the Prevent Open modules are preventing this or when a Close(Buy/ Sell) Signal is active at the same time.

Multiple orders

The Multiple orders - Open module, will allow multiple orders/ positions to be opened at the same time, but won’t hedge. It will only open a consecutive order when the signal has changed from not-active to active or firing in the opposite direction (going from an active ‘Open Buy’ signal to an active ‘Open Sell’ signal or vice-versa).

Settings
  • Maximum open orders: The amount of orders which can be open at the same time by this EA.
Behaviour

When an Open Signal is active it will try to open an order, unless the Prevent Open modules are preventing it or when a Close(Buy/ Sell) Signal is active at the same time.

Modules for closing

Modules for closing take orders as input and close orders when one or more condition, based on the settings, are met. There are currently 10 modules for closing:

Stop loss modules

The Stop loss - Close module, will wait for a loss-value and then close the order(group).

Stop loss
Stop loss
Settings
  • Order scope: the scope (or 'group', if multiple) of orders which is evaluated. Single means every order is evaluated individually and closed individually. Tog is for that Symbol and direction (Buy or Sell), Symbol is all orders from a Symbol and Basket is from any Symbol.
  • Value: the amount of pips/ money the evaluation triggers. Enter a positive value for normal behaviour.
  • Unit: the unit of measurement. Pips or Money (the unit of your account f.e. "$").

Stop loss trailing

The Stop loss trailing – Close module, will wait for the price to go down to the level of where the trail is and then close the order(group). The module effectively sets the SL of an order (on the bottom side of a buy order).

(Image: TODO)

Settings
  • Threshold (pips): this is the profit threshold (in pips) an order/position has to reach for the module to start trailing. Before this value is reached, the module will have zero effect.
    Example: if this value is set to 20, the trail will start when the order/position has a profit of 20 pips.
  • Start value (pips): the profit value (in pips) where the trailing starts.
    Example: if this value is set to 0, the module will try to at least break-even.
  • Trail step size: the amount the trail will go up when the profit increases. Let's assume you put the setting to 1. If the profit increases 1 pip above the threshold value, the trail will move (in this example) from 0 to 1. After another pip of profit, from 1 to 2, etc.. The order will, under normal conditions, now best case create 2 pips of profit. If the setting is set to 2, it will go up 2 pips for every pip of additional profit, instead of 1.

Stop loss catching up trail

The Stop loss catching up trail - Close module, is a module that allows a trader to set a trailing stoploss value, that decreases when a gain0 pips profit is touched, and after gain1 pips profit becomes a “-1” stoploss tracker. The module can be used as a pure trailing stoploss follower if so desired, by setting the gain0 and gain1 values to an unrealistically high pip-value (for example 1000). It allows the trader to use a gradually increasing gain by setting gain1 > gain0, or to instantly jump to the “-1” tracking behaviour from a certain pip-profit onwards, by setting gain0 equal to gain1 .

Settings
  • Threshold (pips): A value in pips. This setting determines at what point the module activates. It expects a value from 0 pips or higher. When set to 0, the module activates at the start of a trade by setting the trailing stoploss to the “Offset” value. When set to (for example) 10, the module activates as soon as a profit of 10 pips compared to the start of the trade is realized.
  • Offset (pips): A value in pips. This value sets the initial offset of the trailing stoploss module. A value of 10 sets the offset to: [profit in pips at activation] – 10 pips. The module expects a positive value.
  • Gain 0 (pips): A value in pips. The typical use-case is that there is a certain profit realized, and the trader decides that the moment to cash-in is nearing. From a profit value of Gain0 in pips, the trailing stoploss starts to decrease the trailing offset. The module expects a positive value, greater than or equal to the Threshold.
  • Gain 1 (pips): A value in pips. Gain tracking is initialized by the Gain0 parameter, and from that point onward the module starts to decrease the trailing offset whenever the profit in pips increases. When the profit in pips reaches the Gain1 value, the module becomes a “-1” tracker, tracking the currency-pair exchange rate – 1 pip. As soon as the rate decreases by 1 the module stoploss is touched and the order is executed.

Note: When using a Threshold > 0 it is advised to also set a fixed stoploss value by adding the StopLoss module. This way, if the rates drop right away you keep control of the situation

Examples

The first example highlights what the module is essentially doing, given parameter values: threshold = 0, offset = 10, gain0 = 15 and gain1 = 25). Evidently, a straight line up is not realistic, but it is clear what the effect is of the parameter values.

Stop loss catching up trail, example 1
Example 1

The second example uses the same parameter values in a more volatile scenario. Notice that from a profit of 15 pips onward the SL rises a bit faster, and stays at its highest value when the pair drops again.

Stop loss catching up trail, example 2
Example 2

Stop loss after condition

The Stop loss after condition – Close module, will wait for the price to drop to the level of where the trail is and then close the order(group). Be aware that the signal goes off at any time, profit or loss, this is irrelevant for the module. It is up to the user to define a good moment to set the order's SL. The SL is just the value where the order will close when the current price is moving in direction of (but not necessarily within) loss.

Stop loss after condition
Stop loss after condition
Settings
  • Stop loss enabled for: if the module is enabled for buy orders, sell orders, or both. If only for buy orders and a separate signal is required for sell orders, simply add a second module of the same type.
  • Stop loss precondition: the condition when the trailing will start. Before the signal goes off, the module remains inactive. When the signal goes off, it will start trailing at the value of the 1st parameter (OnSignalSlTrailOffsetPipValue).
  • Trail distance (pips): the amount of pips the trail is behind the current price, which starts trailing the moment the condition is hit.
  • Trail step size: the amount the trail will rise when the profit rises. Let's assume you put the setting to 1. If the profit rises 1 pip above the threshold value, the trail will move (in this example) from 0 to 1. After another pip of profit, from 1 to 2, etc.. The order will, under normal conditions, now at least create 2 pips of profit. If the setting is set to 2, it will rise 2 pips for every pip of additional profit, instead of 1.

If you want to create a flat SL line you can set StepFactor to 0. Now it's not really trailing, but you created a SL line based on a Signal.

Stop loss after condition version 2

The Stop loss after condition V2 – Close module, will wait for the price to drop to the level of where the trail is and then close the order(group). The SL is just the value where the order will close when the current price is moving in direction of (but not necessarily within) loss.

Stop loss after condition V2
Stop loss after condition V2
Settings
  • Stop loss enabled for: if the module is enabled for buy orders, sell orders, or both. If only for buy orders and a separate signal is required for sell orders, simply add a second module of the same type.
  • Stop loss precondition: the condition when the trailing will start. Before the signal goes off, the module remains inactive. When the signal goes off, it will start trailing at the value of the 1st parameter (OnSignalSlTrailOffsetPipValue).
  • Trail start value: the price at which the trail will start.
  • Trail distance (pips): the amount of pips away from the 'Trail start value' where you want the trail to start.
  • Trail step size: the amount the trail will rise when the profit rises. Let's assume you put the setting to 1. If the profit rises 1 pip above the threshold value, the trail will move (in this example) from 0 to 1. After another pip of profit, from 1 to 2, etc.. The order will, under normal conditions, now at least create 2 pips of profit. If the setting is set to 2, it will rise 2 pips for every pip of additional profit, instead of 1.
  • Close percentage: the percentage of the position that will be closed by this module. Assume you have a position of 1 Lot and you set the value to 50, this module will close 0.5 Lot of the current position. When you have another module set to value 50 as well, it will close 0.25 Lot when that module triggers, which is 50% of the remaining 0.5 Lot. If you wanted the second module to close the entire order/ position, please set the second module's value 100.

If you want to create a flat SL line you can set StepFactor to 0. Now it's not really trailing, but you created a horizontal SL line.

Take profit

The Take profit - Close module, will wait for a profit-value and then close the order(group).

takeprofit
Take profit
Settings
  • Order scope: the scope (or 'group', if multiple) of orders which is evaluated. Single means every order is evaluated individually and closed individually. Tog is for that Symbol and direction (Buy or Sell), Symbol is all orders from a Symbol and Basket is from any Symbol.
  • Value: the amount of pips/ money the evaluation triggers. Enter a positive value for normal behaviour.
  • Unit: the unit of measurement. Pips or Money (the unit of your account f.e. "$").

Take profit trailing

The Take profit trailing – Close module, will wait for the price to go up to the level of where the trail is and then close the order(group). The module effectively sets the TP of an order (on the up side of a buy order).

If you're looking for a module to capture your profit: use the Take profit trailing - Close module.

(Image: TODO)

Settings
  • Threshold (pips): this is the loss threshold an order/position has to reach for the module to start trailing. Before this value is reached, the module will have zero effect.
    Example: if this value is set to -20, the trail will start when the order/position has a loss of 20 pips.
  • Start value (pips): the profit value (in pips) where the trailing starts. If this is set at 0, the order will try to break-even.
  • Trail step size: the amount of pips the trail will drop when the loss rises. Let's assume you put the setting to 1. If the loss rises 1 pip under the threshold value, the trail will move (in this example) from 0 to -1. After another pip of loss, from -1 to -2, etc.. The order will, under normal conditions, now best-case close at 2 pips of loss. If the setting is set to 2, it will drop 2 pips for every pip of additional loss, instead of 1.

TODO: Movie

Take profit after condition

Use this module when you want to close the order when the order is recovering. This is an uncommon scenario for most users. Most users want the trail to be on the bottom side of the price. In that case, use the Stop loss after condition Module.

Take profit after condition – Close module, will wait for the price to go up to the level of where the trail is and then close the order(group). Be aware that the signal goes off at any time, profit or loss, this is irrelevant for the module. It is up to the user to define a good moment to set the order’s TP. The TP is just the value where the order will close when the current price is moving towards more profit.

Take profit after condition
Take profit after condition
Settings
  • Take profit enabled for: if the module is enabled for buy orders, sell orders, or both. If only for buy orders and a separate signal is required for sell orders, simply add a second module of the same type.
  • Take profit precondition: the signal when the trailing will start. Before the signal goes off, the module remains inactive. When the signal goes off, it will start trailing at the OnSignalTpTrailOffsetPipValue profit/loss-point.
  • Trail distance (pips): the amount of pips the trail is ahead the current price, which starts trailing the moment the Signal is hit.
  • Trail step size: the amount the trail will go down when the loss increases. Let's assume you put the setting to 1. If the loss increases 1 pip below the threshold value, the trail will move (in this example) from 0 to -1. After another pip of loss, from -1 to -2, etc.. The order will, under normal conditions, now best case create 2 pips of loss. If the setting is set to 2, it will go down 2 pips for every pip of additional loss, instead of 1.

If you want to create a flat TP line you can set StepFactor to 0. Now it’s not really trailing, but you created a TP line based on a Signal.

Conditional take profit version 2

Use this module when you want to close the order when the order is recovering. This is an uncommon scenario for most users. Most users want the trail to be on the bottom side of the price. In that case, use the Stop loss after condition Module.

The Take profit after condition V2 – Close module, will wait for the price to go up to the level of where the trail is and then close the order(group). The TP is the value where the order will close when the current price is moving towards (more) profit.

trailing stoploss V2
Trailing Stoploss V2
Settings
  • Take profit enabled for: if the module is enabled for buy orders, sell orders, or both. If only for buy orders and a separate signal is required for sell orders, simply add a second module of the same type.
  • Take profit precondition: the activation rule. Setting this values works the same as setting your Signals.
  • Trail start value: the position the trail will start.
  • Trail distance (pips): the amount of pips above the OnSignalTPV2Value where you want the trail to start.
  • Trail step size: the amount the trail will drop when the loss increases. Let's assume you put the setting to 1. If the loss increases 1 pip, the trail will move 1 pip down as well.
  • Close percentage: the percentage of the position that will be closed by this module. Assume you have a position of 1 Lot and you set the value to 50, this module will close 0.5 Lot of the current position. When you have another module set to value 50 as well, it will close 0.25 Lot when that module triggers, which is 50% of the remaining 0.5 Lot. If you wanted the second module to close the entire order/ position, please set the second module's value 100.

Tip: If you want to create a flat TP line you can set StepFactor to 0. Now it's not really trailing, but you created a horizontal TP line.

Maximum lifespan

The Maximum lifespan - Close module, will wait for an amount of time and then close an order, if the order wasn't closed yet by anything.

Settings
  • Maximum minutes: The amount of minutes after which an order is closed compared to it's open time.

Modules which prevent opening

Modules which prevent opening prevents opening any new orders.

Margin requirements

The Margin requirements – Prevent open module, will prevent opening orders based on your margin to protect your account. We advise all live traders to use this module with defensive settings.

Settings
  • Minimum free margin (%): the amount of free margin (in percentage) you require to remain after opening an order/ position. Normal value: 0 - 100. 0 = no limit.
    By using this setting you prevent your account be be called or stopped out after losing a small amount of margin.
  • Maximum ea margin (%): the amount of margin (in percentage) this EA can use. This setting is useful when running multiple EA's on a single account and you want to make sure there's always some margin left for your best EA to open at least a position.
    Normal value: 0 - 100. 0 = no limit.

Maximum spread

The Max Spread – Prevent open module, will wait for the spread to be less than a set amount. If the amount is larger, it will prevent opening a new order.

Settings
  • Maximum spread (pips): the maximum amount of pips between bid and ask.

Trading session

The Trading session – Prevent open module, will wait for opening times and only open orders between opening and close times. The user (you) will have to make sure the correct times are set based on your server's time.

Orders will still be closed by Close- Signals and Modules outside these times.

This module will not automatically close orders. Multiple modules of this moduletype can be added. This module can be used in collaboration with the Trading session exclusion module.

Settings
  • Start Hour (servertime): the hour (using 0-24) when opening new orders/ positions start. Setting it to 13 equals 1PM.
  • Start Minute (servertime): the minutes (0-60) when opening new orders/ positions start.
  • Stop Hour (servertime): the hour (using 0-24) where opening orders/ positions have to be stopped. (0-24).
  • Stop Minute (servertime): the minutes (0-60) when opening new orders/ positions have to be stopped.
You can set per day if the module should have impact on your EA (monday, tuesday, wednesday, thursday, friday saturday or sunday, at server time).

Trading session exclusion

The Trading session exclusion – Prevent open module, will prevent trading during configured times. The user (you) will have to make sure the correct times are set based on your server's time.

Orders will still be closed by Close- Signals and Modules outside these times.

This module will not automatically close orders. Multiple modules of this moduletype can be added. This module can be used in collaboration with the Trading session module.

Settings
  • Start Hour (servertime): the starting hour (using 0-24) of preventing opening new orders/ positions. Setting it to 13 equals 1PM.
  • Start Minute (servertime): the starting minutes (0-60) of preventing opening new orders/ positions.
  • Stop Hour (servertime): the end hour (using 0-24) of preventing opening orders/ positions. (0-24).
  • Stop Minute (servertime): the end minutes (0-60) of preventing opening orders/ positions.
You can set per day if the module should have impact on your EA (monday, tuesday, wednesday, thursday, friday saturday or sunday, at server time).

Time gap between orders

The Time gap between orders – Prevent open module, will wait a set amount of time between the last closed order and a new open order.

Settings
  • Minimum time (minutes): the amount of minutes between two orders (from open- or closetime of the previous order to a new order).
  • Apply to additional order: prevent opening an additional order when an order has recently been opened.
  • Apply to closed order: prevent opening since the last closed orders.

Time gap after loss

The Time gap after loss – Prevent open module, will wait a set amount of time after a previous order with a loss.

Settings
  • Minimum time (minutes): the amount of minutes between two orders (from open- or closetime of the previous order to a new order).
  • Apply before additional order: prevent opening an additional order when an order has recently been opened.
  • Apply after closed order: prevent opening since the last closed orders.
  • Maximum profit (pips): The maximum amount of profit (pips) an order may have for this rule to activate. Setting this value to -5 will allow a small degree of loss (less than 5 pips) without a time gap.

Pip gap between orders

The Pip gap between orders – Prevent open module only works in combination with the Multiple orders - Open Module. Pip gap will wait opening an additional order until there's a certain amount of price between the Open prices of orders.

Settings
  • Pip gap (pips): the amount of pips between multiple orders.
  • Apply to orders in profit: a consecutive order will only open if the price is going 'up' (has gone into the intended direction). This setting is often used to accumulate the open position as the result of confirmation.
  • Apply to orders in loss: a consecutive order will only open if the price is going 'down' (has gone in the opposite direction). This setting is often used to get into a better opening price.

Both the 'Apply to orders in profit' and 'Apply to orders in loss' can be enabled at the same time.

Next: Money manager