Strategy modules

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:

Module for opening

Module for opening take input from Signals and Modules which prevent opening modules and open, or close, orders as a result.

Open order V3 (new)

Please note this module replaces the obsolete (V2) module.

The Open order - Open module, will allow one or 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.

Changes compared to the V2 module:
Open module V2 waits to close orders as long as the current open signal (with its conditions) are active. The general thought behind this is that closing an order, while an open signal is active, would cause a new order (of the same type) to be opened directly after closing the current order, causing the account to waste balance on commissions and spreads. This logic caused some confusing amongst traders when a signal would be active till the end of a bar and thus SL/ TP not being executed by the EA. The current remedy is either wait for the cross to expire (on the next new bar), or to block the open signal after opening an order, by adding the 'Time gap between orders' module.
Open module V3 will only activate on the very first processed quote which results in an active signal and decides on opening/ closing only at that moment. On the next quote, if SL/ TP is hit, the order will be closed, even if all the conditions of the signal are still true. So with V3, if an order closes after the conditions of a signal are met, a new order won't be opened. Instead, it will wait until at least the signal is not active for one quote and then becomes active again.

Open order V2 (obsolete)

Please note there's a new and improved version of this module which contains changes to trading behavior: Open order V3 (new).

The Open order - Open module, will allow one or 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

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

Stop loss
Stop loss
Settings
  • Order scope: the scope (or 'group') of orders which is evaluated for loss. Single means every order is evaluated individually and closed individually. Symbol/ order type creates a group per Symbol and type (Buy or Sell), Symbol creates a group per Symbol and Basket creates a group for all orders of the account.
  • For each group it goes that the orders have to be created by the same EA or EA's with the same Magic Number (EA property).
  • Value: the amount the group is evaluated against. Enter a positive value.
  • Unit: the unit of measurement. Pips, Money or a percentage of your equity.

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
Stop loss catching up trail, example 1
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 2
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 - Conditional

The Stop loss - 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 - Conditional
Stop loss - Conditional
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 SL will be set. 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 - Conditional (Pro)

The Stop loss - Conditional (Pro) – 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 - Conditional (Pro)
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 SL will be set. 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).
  • SL start value: the price at which the trail will start.
  • When to remove SL: the signal which removes the SL.
  • 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.
  • Reuse module after partial close: if module's Close percentage is set to a value smaller than 100, then the module will try to close a part of the order. This setting decides if this module can be used again (if the precondition is met) for the same order.

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 minimum of profit and then close the order(group).

takeprofit
Take profit
Settings
  • Order scope: the scope (or 'group') of orders which is evaluated for profit. Single means every order is evaluated individually and closed individually. Symbol/ order type creates a group per Symbol and type (Buy or Sell), Symbol creates a group per Symbol and Basket creates a group for all orders of the account.
  • For each group it goes that the orders have to be created by the same EA or EA's with the same Magic Number (EA property).
  • Value: the amount the group is evaluated against. Enter a positive value.
  • Unit: the unit of measurement. Pips, Money or a percentage of your equity.

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 - Conditional

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 - Conditional Module.

Take profit - 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 - Conditional
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 TP will be set. 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.

Take profit - Conditional (Pro)

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 - Conditional (Pro) Module.

The Take profit - Conditional (Pro) – 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
Take profit - Conditional (Pro)
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 TP will be set. Setting this values works the same as setting your Signals.
  • TP start value: the position the trail will start.
  • When to remove TP: the signal which removes the TP.
  • 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.
  • Reuse module after partial close: if module's Close percentage is set to a value smaller than 100, then the module will try to close a part of the order. This setting decides if this module can be used again (if the precondition is met) for the same order.

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.
  • Reset timer on new bar: allow an order to be opened from the moment a new bar opens.
  • Allow reverse order: allow a reverse order to be opened, within the set time gap, after closing an order.

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.
  • Allow reverse order: allow a reverse order to be opened, within the set time gap, after closing an order.

Pip gap between orders

The Pip gap between orders – Prevent open module 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