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:

Modules for opening

Modules for opening take input from Signals and Modules which prevent opening and can open orders as a result.

Open order V3

The Open order - Open module, will allow one or multiple orders/ positions to be opened at the same time. It will only open a consecutive order when the signal's conditions have evaluated from not true to true.

Settings
  • Maximum open orders: The amount of orders which can be open in the same direction at the same time by this EA.
  • Hedging: By enabling this option you allow your EA to have both buy- and sell orders open at the same time. If, for example, your Open Buy signal causes a buy order to open first, then both your Open Buy- and Open Sell signals will continue to be evaluated to open an additional buy- or sell order. With Hedging 'off', only Open Buy is evaluated when a buy order is already opened. If you only get 1 order of either type, also make sure your Maximum open orders value is more than 1, or you will never get more than 1 order. With Hedging 'on' it's also possible to open both buy- and sell orders simultaneously, if both the signal's conditions are met at the same time. This is a subscribers-only option.
Behaviour

Every time an Open Signal evaluates true, from being false on the previous quote, it will try to open an order, unless the Prevent Open modules are preventing it or when a Close(Buy/ Sell) Signal evaluated to true, from being false on the previous quote, 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 (legacy)

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

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's condition(s) have evaluated from being not true to being true.

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 evaluated to be true, it will try to open an order, unless the Prevent Open modules are preventing it, or when a Close(Buy/ Sell) Signal is evaluated to be true 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 set a stop loss (SL) directly after opening an order (see '1' in image below). The module will then wait for the SL to be hit (see '2' in image below) and then close the order/ order scope.

Stop loss
Stop loss
Settings
  • Order scope: the scope (or 'group') of orders which is added up together and then evaluated. 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 open orders on the account. If you choose Account, you won't see a line on the chart, but the total loss is calculated and evaluated nonetheless.
    An order scope consists of orders opened by the same EA or all EA's with the same Magic Number (EA property).
  • Value: the amount of loss. Enter a positive value.
  • Unit: the Value unit. Pips, Money or a percentage of equity compared to balance.

Stop loss - Trailing

The Stop loss - Trailing – Close module, will not set a stop loss (SL) directly after opening an order (see '1' in image below), but will wait for the price to hit the threshold (see '2' in image below). Only then the stop loss (SL) is set (see '3' in image below). If the price hits the SL, the module closes the order. The module sets the SL of a buy order below the current price, not necessarily below the buy order's open price. Because the SL is set below the current price, it's possible that when the SL gets hit, the order is in profit; it's also possible because of trailing. Many traders use this module to capture profits the moment the price retraces. For a sell order, everything is in reverse, so the module sets the SL of a sell order above the current price.

Stop loss
Trailing stop loss. SL moves up when the price moves up. SL can go into profit.
Settings
  • Profit threshold (pips): this is the threshold (in pips) an order has to hit, before the SL is set and the SL starts trailing. Before the threshold is hit, the module will have no effect.
    Example: if this value is set to 30, then the SL will be set (and the trailing will start) when the order has a profit of 30 pips.
  • Trail start value (pips): the amount of pips where the SL starts trailing. The SL is set at: Open price + Trail start value (pips).
    Examples: if set to -20, the SL is set to 20 pips of loss. If set to 0, the SL is set to break-even. If set to 20, the SL is set to 20 pips of profit.
  • Trail step size: the amount the trail will gain when the order gains new highs. Let's assume you put the setting to 1. If the profit increases 1 pip above the threshold value, the trail will move 1 pip up as well. If the setting is set to 2, SL will go up 2 pips for every pip of additional profit, instead of 1.
  • Trail minimum distance (pips): the trail will not get closer in pips to the current price than set, in pips. This is usefull when using a Trail step size bigger than 1 and you want the trail to keep a certain distance from the current price. Warning: when set to 0 or any negative number, the trail will be allowed to overtake the current price, causing the order to close before retracing.
    Example: You have a Profit Threshold of 30 pips and you set the Trail start value (pips) to 20. You have a Trail step size of 1. The trail will now always be 10 pips behind the current price. However, if you have a step 10 and the price goes up 1 pip, then the trail will now be at:
    Current profit - Trail start value (pips) + (Trail step size * profit movement) =
    31 - 20 + (10 * 1) = 30
    So the trail is 1 pip behind the current price. If the market goes up one more pip, the trail will still be 1 pip behind the market price, because the minimum distance is set to 1 pip. If you would have a Trail minimum distance (pips) of 0.1 pip then the trail would now be 0.1 pip behind the current price. If you would put Trail minimum distance (pips) to 0, the SL can match the current price and the SL can be hit even though the price never retraced. So, if you don't want an order to get closed when the order is gaining new highs, then use a value of 0.1 or higher.

Stop loss - Catching up trail

The Stop loss - Catching up trail - Close module, allows a trader to set a trailing stop loss, which decreases the distance between the current price and the SL after Gain 0 (in pips) was gained. From the moment the final gain of Gain 1 has been reached, the SL will trail the current price with a distance of 1 pip. The module also allows the trader to use a gradually increasing gain by setting gain1 to a value bigger than Gain 0.

Settings
  • Profit threshold (pips): This value determines at what moment the module activates. When set to 0, the module activates when the order is opened and sets the SL to the distance of the Offset (pips) parameter. F.e. when set to 10, the module activates when an order gained 10 pips of profit. Use a positive value to set this parameter.
  • Offset (pips): This value sets the initial distance of the trailing SL. A value of 10 sets the offset to: current price – 10 pips. Use a positive value to set this parameter.
  • Gain 0 (pips): When an order has gained a profit value equal to the value of this parameter (in pips), the trailing SL starts to decrease the trailing distance. Use a positive value to set this parameter, greater than or equal to the Profit Threshold (pips).
  • Gain 1 (pips): The module starts to decrease the trailing distance if the order gains new highs. When the profit in pips reaches the value of this setting, the SL will be at 1 pip distance.
  • Trail minimum distance (pips): the trail will not get closer to the current price than the set value, in pips. This is usefull when using a Trail step size of more than 1 and you want the trail to keep a certain distance from the current price. Warning: when set to 0 or any negative number, the trail will overtake the price, causing the order to close.
Examples
Stop loss catching up trail, example 1
The first example shows what the module is doing, given parameter values: Profit Threshold = 0, Offset = 10, Gain 0 = 15 and Gain 1 = 25). Evidently, a straight line up is not realistic, but this way it becomes 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 5 pips onward the SL rises a bit faster, and stays at its highest value when the order isn't gaining hew highs.

Stop loss - Conditional

The Stop loss - Conditional – Close module, will evaluate if open orders have hit their SL. After an order has been opened (see '1' in image below), the module will set the stop loss (SL) when a (complex) condition has become true (see '2' in image below). When the price hits the SL (see '3' in image below), the order will be closed. The module sets the SL of a buy order below the current price, not necessarily below the buy order's open price. Because the SL is set below the current price, it's possible that when the SL gets hit, the order is in profit, it's also possible because of trailing. Many traders use this module to capture profits the moment the price retraces. For a sell order, everything is in reverse, so the module sets the SL of a sell order above the current price.

Stop loss - Conditional
Stop loss - Conditional
Settings
  • Enabled for: set the module to be enabled for buy orders only, sell orders only, or both. If buy and sell orders require a different condition, add this module for buy orders and then add this module again for sell orders.
  • Precondition: the condition before the SL is set. Before the condition is evaluated to be true, the module remains inactive. When the condition is evaluated to be true, SL will be set and start at a distance of the SL start distance (pips) parameter. Not setting the precondition results in a set SL at the moment the order is opened.
  • SL start distance (pips): the amount of pips the SL is away from the current price, which is set the moment the Precondition evaluated to be true. SL = current price (bid/ ask) - SL start distance (pips).
  • Trail step size: the amount the trail will gain when the order gains new highs. Let's assume you put the setting to 1. If the profit increases 1 pip above the order's previous high, the trail will move 1 pip up as well. If the setting is set to 2, SL will go up 2 pips for every pip of additional profit, instead of 1.
  • Trail minimum distance (pips): the trail will not get closer to the current price than the set value, in pips. This is usefull when using a Trail step size of more than 1 and you want the trail to keep a certain distance from the current price. Warning: when set to 0 or any negative number, the trail will be allowed to overtake the current price, causing the order to close before retracing.

If you want to create a fixed SL line you can set Trail step size to 0. Now it's not trailing, but instead you've created a fixed SL line based on a condition.

Stop loss - Conditional (Pro)

The Stop loss - Conditional (Pro) – Close module, will evaluate if open orders have hit their SL. After an order has been opened (see '1' in image below), the module will set the stop loss (SL) when a (complex) condition has become true (see '2' in image below). When the price hits the SL (see '3' in image below), the order will be closed. The module sets the SL of a buy order anywhere you want below the current price, not necessarily below the buy order's open price. Because the SL is set anywhere below the current price, it's possible that when the SL gets hit, the order is in profit; it's also possible because of trailing. Many traders use this module to capture profits the moment the price retraces. For a sell order, everything is in reverse, so the module sets the SL of a sell order anywhere you want above the current price.

Stop loss after condition pro
Stop loss - Conditional (Pro)
Settings
  • Enabled for: set the module to be enabled for buy orders only, sell orders only, or both. If buy and sell orders require a different condition, add this module for buy orders and then add this module again for sell orders.
  • Precondition (optional): the condition before the SL is set. Before the condition is evaluated to be true, the module remains inactive. When the condition is evaluated to be true, SL will be set at the value of the SL start value parameter, which can contain a complex calculation. Not setting the precondition results in a set SL at the moment the order is opened.
  • SL start value: the value (price) of SL, set to any value or calculation.
  • When to remove SL (optional): the signal which removes the SL.
  • SL offset (pips): the amount of pips away from the SL start value, to adjust where you want the SL to start.
  • Trail step size: the amount the SL 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 result in 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.
  • Trail minimum distance (pips): the trail will not get closer to the current price than the set value, in pips. This is usefull when using a Trail step size of more than 1 and you want the trail to keep a certain distance from the current price. Warning: when set to 0 or any negative number, the trail will be allowed to overtake the current price, causing the order to close before retracing.
  • 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, that module will close 0.25 Lot, because 50% of the remaining 0.5 lot is 0.25 lot. If you want the first or second module to close the entire order/ position, please set this value to 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 again) for the same order.

If you want to create a fixed SL line you can set Trail step size to 0. Now it's not trailing, but instead you've created a fixed SL line based on a precondition.

Take profit

The Take profit - Close module, will set a take profit (TP) directly after opening an order (see '1' in image below). The module will then wait for the TP to be hit (see '2' in image below) and then close the order/ order scope.

takeprofit
Take profit
Settings
  • Order scope: the scope (or 'group') of orders which is added up together and then evaluated. 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. If you choose Account, you won't see a line on the chart, but the total profit is calculated and evaluated nonetheless.
    An order scope consists of orders opened by the same EA or all EA's with the same Magic Number (EA property).
  • Value: the amount of profit. Enter a positive value.
  • Unit: the Value unit. Pips, Money or a percentage of equity compared to balance.

Take profit - Trailing

Use this module if you want to close the order when the order is recovering from a (large) loss. This is an uncommon scenario for most users. Most users want the trail to be on the bottom side of the price (stop loss), allowing new highs, but stopping out when the price retraces. If that's the case for you, use the Stop loss - Trailing Module.

The Take profit - Trailing – Close module, will not set a take profit (TP) directly after opening an order (see '1' in image below), but will wait for the price to hit the threshold (see '2' in image below). Only then the take profit (TP) is set (see '3' in image below). If the price hits the TP, the module closes the order. The module sets the TP of a buy order above the current price, not necessarily above the buy order's open price. Because the TP is set above the current price, it's possible that when the TP gets hit, the order is in loss; it's also possible because of trailing.

Trailing Take Profit
Trailing take profit. TP moves down when the price moves down. TP can go into loss.
Settings
  • Loss threshold (pips): this is the loss threshold an order has to hit, before the TP is set. The TP is set at: Open price + Trail start value (pips). Before the threshold is hit, the module will have no effect.
    Example: if this value is set to 30, then the TP will be set (and the trailing will start) when the order has a loss of 30 pips.
  • Trail start value (pips): the amount of pips loss where the TP starts trailing.
    Examples: if set to 20, the order will close as soon as the order has 20 pips of loss. If set to 0, the TP is set to break-even. If set to -10, the TP is set to 10 pips of profit.
  • Trail step size: the amount the trail will trail when the order gains new lows. Let's assume you put the setting to 1. If the loss increases 1 pip below the threshold value, the trail will move 1 pip down as well. If the setting is set to 2, TP will go down 2 pips for every pip of additional loss, instead of 1.

Take profit - Conditional

Use this module if you want to close the order when the order is recovering from a (large) loss or if you want to reduce the target TP when the price is moving against you. This is an uncommon scenario for most users. Most users want the trail to be on the bottom side of the price (stop loss), allowing new highs, but stopping out when the price retraces. If that's the case for you, use the Stop loss - Conditional Module.

Take profit - Condition – Close module, will set the take profit (TP) when a (complex) condition has become true (see '2' in image below). When the price hits the TP (see '3' in image below), the order will be closed. The module sets the TP of a buy order above the current price, not necessarily above the buy order's open price. Because the TP is set above the current price, it's possible that when the TP gets hit, the order is in loss, it's also possible because of trailing. Many traders use this module to reduce losses the moment the price retraces back in their favour. For a sell order, everything is in reverse, so the module sets the TP of a sell order below the current price.

Take profit after condition
Take profit - Conditional. Trailing TP is set to lower the TP goal (price traces down with the price moving down).
Settings
  • Enabled for: set the module to be enabled for buy orders only, sell orders only, or both. If buy and sell orders require a different condition, add this module for buy orders and then add this module again for sell orders.
  • Precondition (optional): the condition before the TP is set. Before the condition is evaluated to be true, the module remains inactive. When the condition is evaluated to be true, TP will be set and start at a distance of the TP start distance (pips) parameter. Not setting the precondition results in a set TP at the moment the order is opened.
  • TP start distance (pips): the amount of pips the TP is away from the current price, which is set the moment the Precondition evaluated to be true. TP = current price (bid/ ask) + TP start distance (pips).
  • Trail step size: the amount the trail will gain when the order gains new lows. Let's assume you put the setting to 1. If the loss increases 1 pip below the order's previous low, the trail will move 1 pip down as well. If the setting is set to 2, TP will go down 2 pips for every pip of additional loss, instead of 1.

Tip: If you want to create a fixed TP line you can set Trail step size to 0. Now it's not trailing, but instead you've created a fixed TP line.

Take profit - Conditional (Pro)

Use this module if you want to close the order when the order is recovering from a (large) loss. This is an uncommon scenario for most users. Most users want the trail to be on the bottom side of the price (stop loss), allowing new highs, but stopping out when the price retraces. If that's the case for you, use the Stop loss - Conditional (Pro) Module.

The Take profit - Conditional (Pro) – Close module, will evaluate if open orders have hit their TP. After an order has been opened (see '1' in image below), the module will set the take profit (TP) when a (complex) condition has become true (see '2' in image below). When the price hits the TP (see '3' in image below), the order will be closed. The module sets the TP of a buy order anywhere you want above the current price, not necessarily above the buy order's open price. Because the TP is set anywhere above the current price, it's possible that when the TP gets hit, the order is in loww; it's also possible because of trailing. Many traders use this module to reduce losses the moment the price retraces back in their favour. For a sell order, everything is in reverse, so the module sets the TP of a sell order anywhere you want below the current price.

trailing stop loss pro
Take profit - Conditional (Pro)
Settings
  • Enabled for: set the module to be enabled for buy orders only, sell orders only, or both. If buy and sell orders require a different condition, add this module for buy orders and then add this module again for sell orders.
  • Precondition (optional): the condition before the TP is set. Before the condition is evaluated to be true, the module remains inactive. When the condition is evaluated to be true, TP will be set at the value of the TP start value parameter, which can contain a complex calculation. Not setting the precondition results in a set TP at the moment the order is opened.
  • TP start value: the value (price) of TP, set to any value or calculation.
  • When to remove TP (optional): the signal which removes the TP.
  • TP offset (pips): the amount of pips away from the TP start value where you want the TP to start.
  • Trail step size: the amount the TP 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) 1 pip down as well. After another pip of loss, from 1 to 2 pip, etc.. The order will, under normal conditions, now at least result in 2 pips of loss. If the setting is set to 2, TP will go down 2 pips for every pip of additional loss, 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, that module will close 0.25 Lot, because 50% of the remaining 0.5 lot is 0.25 lot. If you want the first or second module to close the entire order/ position, please set this value to 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 fixed TP line you can set Trail step size to 0. Now it's not trailing, but instead you've created a fixed TP line based on a precondition.

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.

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 new orders based on your available margin, to protect your account to some degree from margin calls. 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. When entering 100, you will not get an open order, because your free margin would drop below 100%.
  • Maximum EA margin (%): the amount of margin (in percentage) this particular EA can use. This setting can also be useful when running multiple EA's on a single account and you want to make sure there's always an amount of margin left for this EA to open an order. For example, you have 2 running EA's: 'EA 1' and 'EA 2'. Both EA's use 10% of margin to open an order. You never want less than 60% of free margin. Also, you want 'EA 1' to always be able to open at least 1 order, because it's your best EA. You can put Minimum free margin (%) to 60% on both EA's, then you can put this (Maximum EA margin (%)) setting to 40% for 'EA 1' and 30% for 'EA 2'. Now, 'EA 2' can open 3 orders and there will still be 10% of margin left for 'EA 1' to open 1 order.
    Normal value: 0 - 100. 0 = no limit. When entering 0, you will not get an open order, because your EA can't use enough margin to open an order. If your EA opens orders using 10% of margin, then this setting should be at least 10.
Margin Level

The percentages used in the settings above are not referring to the Margin Level percentage. Let's say you want to at least stay above 400% of Margin Level. Here's an example on how to use this module: you have an account of 10.021 USD, which means you now have 10.021 USD of free margin, which is 100% of 'free margin' and 0% of margin used. If I open an order of 0.05 BTC, I'll use 743 USD of margin. That's about 7.4% of margin used by this particular EA. So my 'free margin' is now 92.6%. If I had set the 'Maximum EA margin' to 7.4%, or the minimum free margin to 92.6%, the EA could now no longer open a second order, because the next order would use 7.4% as well. 14.8% (7.4% + 7.4%) would exceed the maximum of margin 7.4% and also the minimum of free margin of 92.6% would be violated. Had I put a maximum of 5% from the start, then the first 0.05 BTC order wouldn't have opened either, because before opening an order the amount of required margin is calculated and evaluated.

Now about the Margin Level percentage. Let's say you want a Margin Level minimum of 400%:
Minimum free margin (%) = 100 - 100 x (100 / Margin Level)
Minimum free margin (%) = 100 - 100 x (100 / 400)
Minimum free margin (%) = 75
So your 'Minimum free margin (%)' setting should be set to 75. Alternatively, you could set your EA to only use 25% of your margin, by setting the 'Maximum EA margin (%)' to 25.

Maximum spread

The Max Spread – Prevent open module, will prevent your Open Buy/ Open Sell signals from opening an order if the spread (difference between bid and ask) is bigger than a set amount. If this is the case and the spread decreases below the maximum at a later time, the Open Buy/ Open Sell signal needs to activate again before an order is opened; old activations do not cause an order to be opened.

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

Trading session

The Trading session – Prevent open module, will prevent opening orders outside opening and close times.
Example: we set the module to only open orders between 09:00 and 15:00. The module prevents opening orders from 15:00 afternoon till the next morning 09:00. So, if you set the trading session to between 09:00 and 15:00, then you allow an order to be opened at 9:30 or 10:00, but not at 18:00 or 06:00 (outside of the session). In this example, if the Open signal (Open buy/ Open sell) activates at 09:10 then the module won't prevent the order from opening.
You will have to make sure the times are set based on your broker's server time correctly.

You can find your current broker's server time at the top of the Market Watch in MetaTrader, or in the top left corner of the chart after adding your EA.

Orders will be closed by Close- Signals and Modules within or outside of these times; this module will not automatically close orders. Neither will it prevent the order(s) from being closed. Only 1 modules of this type can be added. This module can be used in collaboration with the Trading session exclusion module.

When backtesting on our online backtesting servers, the time on MT4 and MT5 is set to GMT+3 while US daylight savings is in place, and GMT+2 when the US is not under daylight savings.

Settings
  • Start Hour (servertime): the hour (using 0-23) when opening new orders/ positions start. Setting it to 13 equals 1PM.
  • Start Minute (servertime): the minutes (0-59) when opening new orders/ positions start.
  • Stop Hour (servertime): the hour (using 0-23) where opening orders/ positions have to be stopped.
  • Stop Minute (servertime): the minutes (0-59) when opening new orders/ positions have to be stopped.
You can set, per day, if the module should affect your EA (Monday, Tuesday, Wednesday, Thursday, Friday Saturday or Sunday, at server time). So if you only enable Monday and set your Trading times between 09:00 and 15:00, then your trading times are only affected on Monday. On all other days, your EA will be able to trade whenever it needs to. If you need to disable trading on the other days, please also add the Trading session exclusion module.

Trading session exclusion

The Trading session exclusion – Prevent open module, will prevent trading during set times.
Example: we set the module not to open orders between 15:00 and 09:00. The module prevents opening orders from 15:00 afternoon till the next morning 09:00. So, if you set the trading session exclusion to between 15:00 and 09:00, then you allow an order to be opened at 9:30 or 10:00, but not at 18:00 or 06:00 (wihtin the exclusion). In this example, if the Open signal (Open buy/ Open sell) activates at 09:10 then the module won't prevent the order from opening.
You will have to make sure the correct times are set based on your broker's server time.

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

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

When backtesting on our online backtesting servers, the time on MT4 and MT5 is set to GMT+3 while US daylight savings is in place, and GMT+2 when the US is not under daylight savings.

Settings
  • Start Hour (servertime): the starting hour (using 0-23) of preventing opening new orders/ positions. Setting it to 13 equals 1PM.
  • Start Minute (servertime): the starting minutes (0-59) of preventing opening new orders/ positions.
  • Stop Hour (servertime): the end hour (using 0-23) of preventing opening orders/ positions. (0-24).
  • Stop Minute (servertime): the end minutes (0-59) 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). So if you only enable Monday and set your Trading exclusion times between 18:00 and 09:00, then your trading times are only affected on Monday. On all other days, your EA will be able to trade whenever it needs to. If you need to disable trading on the other days, please also enable this module for other days, or add the same module again, using different times and days, if this is what you require.

Time gap between orders

The Time gap between orders – Prevent open module, will wait a set amount of time between the last (open or 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 and is still open. The open time of that order will be compared to the current time.
  • Apply to closed order: prevent opening a new order since the last closed order. The close time of that order will be compared to the current time
  • Reset timer on new bar: always allow an order to be opened from the moment a new bar on the current timeframe (timeframe of the chart) starts.
  • Allow reverse order: always allow a reverse order to be opened, within the set time gap.

Time gap after loss

The Time gap after loss – Prevent open module, will prevent opening a new order for a set amount of time when an order is in loss or a closed order resulted in a loss.

Settings
  • Minimum time (minutes): the amount of minutes between two orders (from open- or close time of the previous order to a new order).
  • Apply before additional order: prevent opening an additional order when an open order is in loss.
  • Apply after closed order: prevent opening when the most recent closed order resulted in a loss.
  • 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 this module prventing a new order. Setting this value to 1 means even an order making a small a pip profit (excluding commissions) is counted as a loss. Setting this value to 0 means a loss is a loss, no matter how small.
  • Allow reverse order: allow a reverse order (a buy after a sell or a sell after a buy) to be opened in any case.

Pip gap between orders

The Pip gap between orders – Prevent open module will prevent the opening of 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 in your favour. 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 against you. This setting is often used to get into a (by average) better position.
  • Allow reverse order: always allow a reverse order to be opened, within the set pip gap.

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

Important considerations

This module only prevents opening orders and does not open a new order when the gap has been formed. If you need an order to open automatically once the gap has been formed, please check out our 'Grid Trend' and 'Grid Trend reversal' EA templates and study the Open Buy and Open Sell signals.

Maximum loss

The Maximum Loss – Prevent open module, will prevent opening new trades when an amount of loss has been reached within a window of time (timeframe), including the profit/loss of the currently opened orders.

Settings
  • Maximum loss: the maximum amount of loss in pips, money or percentage of your equity.
  • Unit: Select pips, money or percentage of your equity.
  • Timeframe: Select the timeframe in which the loss has been reached. For example if you select D1, then all losses in the current day will add up to your total amount of loss.
    Current = loss within timeframe of the chart.
    M1 = loss within 1 minute.
    M5 = loss within 5 minutes.
    M15 = loss within 15 minutes.
    M30 = loss within 30 minutes.
    H1 = loss within 1 hour.
    H4 = loss within 4 hours.
    D1 = loss within 1 day.
    W1 = loss within 1 week.
    MN1 = loss within 1 month.

Afterthought from the team

We could've built a module which closes all current orders when the maximum loss has been reached, but we decided not to and instead only prevent opening new orders. Why? We believe when an EA opens an order it should allow for the order to run its normal course, instead of potentially being cut off premature. We believe that maximum loss shouldn't be an afterthought, but should be a well thought out part of the EA. Therefore we recommend the following approach: when you want a maximum of 5% of loss a day without passing that percentage, then please make sure that the sum of your maximum loss (of this module) and your Stop Loss percentage (from the Stop Loss module) will never pass 5%. So if your Stop Loss module has a SL of 1% of equity, then you would be wise to set this module to 3.5 % of equity.

Maximum profit

The Maximum Profit – Prevent open module, will prevent opening new trades when an amount of profit has been reached, withing a window of time (timeframe), including the profit/loss of the currently opened orders.

Settings
  • Maximum profit: the maximum amount of profit in pips, money or percentage of your equity.
  • Unit: Select pips, money or percentage of your equity.
  • Timeframe: Select the timeframe in which the profit has been reached. For example if you select D1, then all profits in the current day will add up to your total amount of profit.
    Current = profit within timeframe of the chart.
    M1 = profit within 1 minute.
    M5 = profit within 5 minutes.
    M15 = profit within 15 minutes.
    M30 = profit within 30 minutes.
    H1 = profit within 1 hour.
    H4 = profit within 4 hours.
    D1 = profit within 1 day.
    W1 = profit within 1 week.
    MN1 = profit within 1 month.

Afterthought from the team

We could've built a module which closes all current orders when the maximum profit has been reached, but we decided not to and instead only prevent opening new orders. Why? We believe when an EA opens an order it should allow the order to run its normal course, instead of potentially being cut off premature. We believe that maximum profit shouldn't be an afterthought, but should be a well thought out part of the EA. Therefore we recommend the following approach: when you want a maximum of 5% of profit a day without passing that percentage, then please make sure that the sum of your maximum profit (of this module) and your Take profit percentage (from the Take Profit module) will never pass 5%. So if your Take profit module has a TP of 1% of equity, then you would be wise to set this module to 3.5 % of equity.

Next: Money manager