The main purpose of this blog is to describe and explain the input parameters of my Triple Moving Average Expert Advisor (MT4 version (discontinued) / MT5 version).
Please check out my other Moving Average products for MT4:
Trend dashboard, Moving Average Crossover scanner
For MT5:
Trend dashboard, Moving Average Crossover scanner
This is an out-of-the-box product which will normally not be modified based on request from a single customer. Please therefore first read this blog to the end and/or download a demo and test the EA in the strategy tester in order to understand what it can and cannot do.
The EA comes with a cost averaging function which means that it can place additional trades in the same direction as the original order when the price goes against you. The condition for retrieving the PIN code for activation of this function in the MT4 version is that you will contact me via private message here on MQL5. This function can be used as a grid system or as pure martingale system (exponential increasing of lot size) or smoothed martingale (for instance linear increasing of the lot size). Due to the risk involved, using this function is more suitable for intermediate to advanced trader who is well aware of how to handle risk management. If not used wisely it will probably blow your account sooner or later. Important is to test this function in your strategy tester and/or on a demo account using different settings for at least a week so that you will understand how it works. I cannot stress this enough.
Whenever there is an available update of the EA I recommend you to wait with updating until all open positions by the EA have been closed. You can update it without removing the previous version from the chart. Before updating I also recomend to turn off AutoTrading and after the update please control that the input parameters have not changed on each chart where the EA is loaded. Then you can turn on AutoTrading/Algo Trading again.
I strongly recommend you to do your own backtesting and fine tuning in the strategy tester before starting to trade on a live account. This is valid also if you decide to use the .set (preset) files which you can download at the end of this blog. You must use the 'Every tick based on real ticks' option in MT5 and 'Every tick' (emulated ticks) in MT4 if you are using settings where intracandle activities are involved, such as trailing stop. If not then it is enough with 'Open price' in MT4 and '1 minute OHLC' in MT5. Please remember that past performance is not a guarantee of future profitability and that the optimized backtest results cannot provide a realistic prediction of future profitability. Signal monitoring here.
Input parameters
Parameters marked with an asterisk (*) in the beginning are only available in the MT5 version and parameters marked with two asterisks (**) in the beginning are only available in the MT4 version (which has been discontinued). Parameters marked with blue text are parameters which will be used from preset files when you use the EA in Multi symbol mode with any of the 2 preset files options in the 'Multi symbol mode' input parameter.- GENERAL SETTINGS
- ** Send alert instead of opening trade
- * EA mode - List box with the following selections:
- Trade normally
- Send alert instead of opening trade - Will alert about trades instead of opening them
- Pause EA - Will totally pause the EA. Existing orders will not be modified in case break even, trailing stop etc. has been enabled.
- Close order(s) and pause EA - Will close all open orders for the current magic number and then pause the EA.
- * Multi symbol mode - List box with the following selections:
- Disabled - The EA will only trade the current chart symbol.
- Market Watch - All visible symbols in the Market Watch window.
- Symbols from input parameter - Symbols given in the 'Symbols to trade' input parameter below.
- Presets from folder - Symbols from preset files selected in a dialog box. These presets must exist directly under the Files folder, or in a subfolder to Files. Each preset file must contain the name of the symbol according to how it is written in the Market Watch window. Parameters marked with blue text are parameters which will be used from preset files when you have selected this option. The other parameters vill be taken from the EA.
*** in tester mode the files must be placed in the testing_agent_directory\MQL5\files folder. For instance ...\Program Files\ICMarkets - MetaTrader 5\Tester\Agent-127.0.0.1-3000\MQL5\Files *** - Presets by selection - Symbols from all existing preset files in a predefined folder (given in the 'Preset files folder...' input parameter below). These presets must exist directly under the Files folder, or in a subfolder to Files. Each preset file must contain the name of the symbol according to how it is written in the Market Watch window. Parameters marked with blue text are parameters which will be used from preset files when you have selected this option. The other parameters vill be taken from the EA.
*** this option is not supported in the strategy tester *** - * Symbols to trade - These symbols will be used when the 'Symbols from input parameter' Multi symbol mode has been selected above. In this case the EAs internal input parameters will be used. The symbols must be comma separated and visible in the Market Watch window.
- * Preset files folder (must be subfolder under Files) - All preset files in this folder will be loaded when the 'Presets from folder' Multi symbol mode has been selected above.
- Trade mode - List box with the following selections:
- Triple MA - Default mode.
- 2 MA crossover - The EA will trade regular crossovers of 2 moving averages on the last 2 bars. Please note that only the 'MA1/MA2 cross' and 'Fixed stop loss' Exit methods will work with this mode.
- Hull MA color change - The EA will trade upon a color change of a single Hull moving average (HMA). If you would like to see the Hull lines on the chart in MT4 then you can download and install the indicator which you will find it at the end of this blog. The Hull lines will automatically be added in the MT5 version of the EA.
- Heiken Ashi smoothed color change - The EA will trade upon color change. If you would like to see the Heiken Ashi bars on the chart in MT4 then you must separately download and install this indicator for MT4. The MT5 indicator will automatically be added in a subwindow in the MT5 version of the EA.
- Use Hull moving average for trend/*double/*triple - 'true' or 'false'. If set to 'true' then the Hull MA will be used instead of the regular trend MA as well as for the MA lines in Double and Triple MA trading modes.
- Open new trade at crossover - This option will only be used if the Exit mehod has been set to 'MA1/MA2 cross'. If set to True, and also the Trade mode is set to '2 MA crossover' or 'Hull MA color change', then the current trade will be closed at an opposite crossover or color change (if TP has not been hit before that) and a new trade will be opened in the direction of the crossover or color change. If Trend moving average has been enabled it will not be used in this case and a new tade will be opened even if the price is on the wrong side of the trend MA. I don't recommend setting this value to True if you have set the value to 0 in the 'Candle shift' parameter below. Please be aware that orders will be opened without involving spread, time and news filters.
- Reverse system (sell when buy, buy when sell) - 'true' or 'false'. Having it set to 'true' should be used in case the trader thinks that a certain MA cross combination very often is a fake signal and that price will revert back after the cross. Then the trades will then be opened in the opposite direction. Please note that the reverse logic will also use reverse Trend MA logic (if Trend MA has been enabled).
- Candle shift - Default is 1. This means that if there is a signal the trade will be opened when the next candle opens. This is valid also for the Exit methods. Setting it to 0 will instruct the EA to open and exit a trade intracandle (unconfirmed signal). You will then be able to catch the move earlier and gain some extra pips. On the other hand there might be more false signals. You could also get many orders in different directions since there could be several crosses or color changes during the candle's lifetime. That is why I highly recommend keeping value 1.
- ADR period (days) - Average daily range over the past xx days. Default is 60. ADR is a percentage value which can be used for take profit (TP), stop loss (SL) and trailing stop (TS). In order to activate it you will need to set a negative value in these input parameters. A value of for instance -25 in the 'Fixed take profit' parameter means that TP will be set to 25% of ADR. If ADR for the last 60 days is 800 points then TP will be set to 200 (800*0,25).
- Event handler on minute candle instead of tick - 'true' or 'false'. If set to True then the testing will be quicker in the strategy tester but less accurate in case you are using settings which involved intracandle activities. For instance trailing stop.
- GENERAL TRADING FILTERS
- Open buy order - 'true' or 'false'.
- Open sell order - 'true' or 'false'.
- Maximum allowed slippage in points (0=disabled) - Please note that not all brokers/account types support slippage control.
- Maximum allowed spread in points (0=not used) - Can be set to avoid taking trades with high spread directly after midnight market opening or at news releases. Useful for those with variable spreads. The default settings of 50 is for currencies.
- Bars for next trade (0 = disabled) - If set to another value than 0 then there must be at least this amount of bars between 2 trades. If positive value then the last order open time will be used, if negative then the last order close time. We can take the example that the EA is trading on a M15 chart. An order was opened 11:45 and closed 12:10. If you have set value to -2 then a next trade will not be possibe until 12:45.
- TIME FILTERS
- ** Enable trade time filter (server time) - 'true' or 'false'. This is the time which the broker is using and is visible at the top of the Market Watch window.
- ** Trading from time (hh:MM)
- ** Trading to time (hh:MM)
- ** Stop time Friday (hh:MM, 00:00=disabled) - Hour and minut when to stop trade on a Friday.
- * Weekdays to trade [1-Mon..7-Sun] - If you for instance would like the EA to trade every weekday except Friday the value must be set to 1234. The default value -1 means that the EA is allowed to trade every day.
- * Start hour [0-23]
- * Start minute [0-59]
- * Stop hour [0-23]
- * Stop minute [0-59]
- * Stop time Friday (-1=disabled) - Hour when to stop trade on a Friday.
- NEWS SETTINGS
- Enable news filter - 'true' or 'false'. The news filter will not be used for averaging orders.
- News provider (Metaquotes will be used in tester) - List box where you can select from the following news providers (URL must be added to the allowed WebRequests):
- Forex factory: https://nfs.faireconomy.media
- Investing: https://ec.forexprostools.com *** Investing.com have recoded their web pages 19.3.2023 in order to prevent the use of their calendar from any external software. This means that this news option will not work anymore ***
- * Metaquotes: The events visible under the Calender tab in MT5. No URL needed. This option will automactically be used in the strategy tester. Please be informed that the news filter will only work in non optimization mode.
- Update interval (time frame) - Default value is 'current'. This means the current chart time frame. So if you for instance are trading on a H1 chart the news will be updated each hour.
- News currencies (symbol currencies if empty) - Here you can specify additional or other currencies (the chart currencies must also be added if you would like to include them as well). Could for instance be set to EUR if you are trading DE30 (DAX). The currencies must be separated by a comma. If left empty then the chart currencies will be used. If the chart is a EURUSD chart then USD and EUR news will be used.
- Events - List box parameter with 5 selections:
- Custom - Custom events. Must be defined in the next parameter.
- HIGH - High impact news only.
- HIGH,MED - High and medium impact news.
- HIGH,MED,LOW - High, medium and low impact news.
- SPEECH - Speeches only
- Custom events, if selected above (separated by comma) - Here you can filter on custom events. For instance putting here Non-Farm, in combination with having 'Custom' selected above, will stop from opening new trades only at NFP (Non-Farm Payrolls) news.
- Pause before news (minutes)
- Pause after news (minutes)
- Chart offset in hours (0=automated)
- Draw news lines on chart - 'true' or 'false'. Lines are drawn on the candle on which time span the news will be released (your broker's time). The lines will not be drawn in tester visual mode.
- Draw only future news lines - 'true' or 'false'.
- Line color for low impact
- Line color for medium impact
- Line color for high impact
- RISK MANAGEMENT (levels are in points)
It is possible to set risk or lot size on a global level by changing it on one place only. It will then be valid for all charts in a Metatrader instance where the EA has been loaded. Hit F3 on the keyboard and change the value of the 'TripleMA-Lots' global variable from 0. A negative value means that risk percentage will be involved. For instance the value -1.5 means that the EA will use a 1.5 percent risk. Positive values means that a fixed lot size will be used, corresponding to the value.
- Risk in percentage (>0 = auto lot) - If set to 0 the Manual lots value will be used. If set to > 0 then the EA will use money management if combined with a fixed stop loss. The account free margin (in the deposit currency) is used for the risk calculation. The risk calculation might not work properly with metals and indices. Please for that purpose use a manual lot. If cost averaging has been enabled the risk will not be calculated correctly. Only based on the first original order. Therefore it is important for you to do your own risk calculation depending on the Lot multiplier and Amount of averaging orders settings.
- Manual lots - Will be used if Risk above is set to 0.
- Allow only one order per symbol and direction - ** this setting will not be used if averaging has been enabled ** Set to True and you will never risk that for instance that a second sell order will be opened for the chart symbol. Useful if you are trading the same symbol on several charts and with different magic numbers. It is possible to enable this on a global level by changing it on one place only. It will then be valid for all charts in a Metatrader instance where the EA has been loaded. Hit F3 on the keyboard and change the value of the 'TripleMA-OneOrder' global variable from 0 to 1. In order for this to work the order comment must contain the word 'Triple'.
- Max. open positions (0=disabled) - ** this setting will not be used if averaging has been enabled ** Set to for instance 5 and you will never risk that the EA will have more than 5 active trades. Useful if you have the EA running on several charts and would like to reduce the risk. It is possible to enable this on a global level by changing it on one place only. It will then be valid for all charts in a Metatrader instance where the EA has been loaded. Hit F3 on the keyboard and change the value of the 'TripleMA-MaxOrders' global variable from 0 to a hihger value. In order for this to work the order comment must contain the word 'Triple'.
It is important to understand the logic and functionality of the following parameters. If something is not clear then please contact me by sending me a private message (PM).
- * Stop trading when Equity decreased (0=disabled) - will not open any new orders if the equity is decreased by this number. If you put for instance 1000 and your current balance is 4000 then the EA will not open new trades if your equity goes below 3000.
- * Stop trading when Free margin below (0=disabled) - will not open any new orders if the free margin goes below this number.
- Max allowed balance drawdown % (100=disabled) - This function will prevent opening of new trades on other charts where the EA is running if your accumulated floating loss (compared with the current balance) is less than xx%. 0 value in this parameter is not allowed and will cause the EA to malfunction in some cases. If the 'Close orders' parameter (explained below) has been set to False then already opened orders on all charts will continue to run. Swaps and commissions are not calulated to the floating loss.
- Orders with this Magic number (0=all) - With the default value (67) the EA will only check open order where the Magic number starts with 67. So if you have other EAs running with open orders then they will not be taken into consideration.
- Close orders - If set to True then all orders, where the magic number starts with the value you have set above, will be closed immediately when the max value has been reached.
- POSITION MANAGEMENT (levels are in points)
- Exit method - List box with the following selections (closing regardless of if in profit or not):
- MA1/MA2 cross (default) - The position will be closed automatically when the first MA has crossed the second at candle close. If the price goes in the wrong direction then this will work as a virtual stop loss.
- Fixed stop loss
- MA1/MA2 distance < min. distance - Will speed up the closing (stop loss) of the order. Will not wait for the first MA to cross the second. Instead it will close the order when the distance between them is less than the minimum distance.
- MA1/MA2 distance < than MA2/MA3 distance
- Which of the above occurs first
- Close at trend MA - Will use the 'Trend MA period' parameter value for closing the trade (virtual SL) when the price has reached this MA value. The 'Use trend moving average' parameter does not have to be set to True for this to work. Please note that a trade could be closed before the Trend MA has been reached if the value in the 'Open new trade at crossover (2 MA crossover mode)' parameter has been set to True.
- MA1 higher/lower - Will close the trade if the distance between MA1 and M2 is smaller than on the previous candle.
- ATR stop loss - A fixed stop loss will be set according to the value you have set in the 'Stop loss ATR multiplier' parameter under the ATR SETTINGS section below.
- Heiken Ashi smoothed color change
- Hull color change
- * At nearest supply/demand zone - *** this option cannot be used in multi symbol mode *** Will set the stop loss at the outer border of the the nearest supply/demand zone. The value in the 'Offset' input parameter (in the SUPPLY/DEMAND SETTINGS section below) can be set to a greater value than 0 in order to adjust the the stop loss a bit away from the zone.
- * At candle high/low - Stop loss will be set at high/low for the current or xx previous candles. It also possible to set candle time frame and an offset from high/low.
- Fixed stop loss (<0=ADR%, >0=points) - will be used as a regular stop loss of the value in the Exit method parameter above has been set to Fixed stop loss. Else you could use this parameter to set an "emergency" stop loss.
- Take profit method - List box with the following selections:
- Fixed
- Trailing stop – starts to trail when profit>=0
- Risk/Reward (based on SL) - If you for instance would like RR 1:3 you need to set the value to 3 in this parameter.
- Close at max. distance - Will close the trade if the distance between MA1 and MA2 is larger then the value you have set in the 'Max. distance between signal MA' parameter under the SIGNAL MOVING AVERAGE (MA) SETTINGS section below.
- Close whole position at first ATR level - With this option a fixed TP will be set when the trade is opened. The level of the TP is determined by the value you have set in the 'Take profit 1 ATR multiplier' parameter under the ATR SETTINGS section below.
- Close half at ATR 1 and rest at ATR 2 - A fixed TP will be set at the ATR 2 level. Half of the lots will be sold at the ATR 1 level (a line showing this level will be drawn on the chart) and the remainder at the fixed TP level. If you will use this option, it is important that your broker supports partial close of an order.
- ATR trailing stop - Will use a traling stop based on the ATR indicator and the settings you have set in the ATR SETTINGS section below. The trailing stop will trigger even if the SL value is below the order open price.
- ATR trailing take profit - When using this option the TP will be adjusted at each new candle based on the previous candle's ATR value. It can be ajdusted both up and down.
- * At nearest supply/demand zone - *** this option cannot be used in multi symbol mode *** Will set the stop loss at the inner border of the the nearest supply/demand zone.
- * Candle high/low trailing stop - Trailing stop will be set at high/low price for the current or xx previous candles. It also possible to set candle time frame and an offset from high/low.
- Fixed take profit (<0=ADR%, >0=points) - Will always be used if set to >0. Will override any Exit or Take profit method if this value is reached first.
- Virtual TP, remaining % to TP - ** Do not enable this feature if you have enabled averaging ** Virtual take profit (immediate close) will be used when the price is x % away from TP. For instance if the difference between the order open price and take profit is 200 points (20 pips) then using the value 10 in this parameter will result in the order been closed when the price is 20 points (10% from 200) away from take profit. This option can be used for instance if you have a market maker broker. It is also possible to set this value on a global level by changing it on one place only. It will then be valid for all charts in a Metatrader instance where the EA has been loaded. Hit F3 on the keyboard and change the value of the 'TripleMA-TP' global variable from 0 to for instance 10.
- Trailing stop (<0=ADR%, >0=points) - Will trail the stop loss constantly with the distance you have set as soon as the trade is in profit.
- Trailing step (negative value = seconds) - If the trailing step is set to a negative value, for instance -60 then the trailing stop will be adjusted each minute. Else the trailing stop will be adjusted every time the price has moved the amount of points you have set here.
- * Set traling stop only when above/below open price
- Risk/Reward ratio: You need to set the 'Take profit method' parameter to Risk/Reward in order for this value to have any effect. You need also to set “Exit method' to 'Fixed stop loss' and a fixed stop loss value. A stop loss value of 200 points and a R/R ratio of 1.5 would mean that the take profit level would be automatically set to 300 points when an order is opened.
- Break-even (0 = disabled) - Break-even level. If for instance break-even is set to 10 (points) and trigger below set to 100 (points) then the SL will be set 10 points above/below the entry price when the trade has reached 100 points profit.
- Break-even trigger - The price has to reach this level (calculated from the opening price) in order for the break-even to be set.
- * Offset (<0=ADR%, >0=points, 0=disabled) - Additional distance for for the stop loss (if it has been set to 'At divergence candle high/low' or 'At candle high/low').
- * Time frame for SL
- * Candle shift for SL
- ATR SETTINGS
- ATR period
- Price type - Select from High/low, Median or Close
- Take profit 1 ATR multiplier
- Take profit 2 ATR multiplier
- Stop loss ATR multiplier - This value is used when you have set the 'Take profit method' to ATR trailing stop.
- ADDITIONAL ENTRY CONDITIONS
- Volume average period (0=volume filter disabled) - If you will use this filter then you can use for instance 13 or 20.
- Volume over average (percent) - Default is 20. If the volume on the base candle is over the average by 20% or more then the signal is valid.
- Enable ADX - 'true' or 'false'. Please see below under the ADX/RSI/MOMENTUM FILTER SETTINGS section.
- Minimum momentum strenght (0=disabled) - This setting is based on the Metatrader Momentum indicator and values to set here are indvidual for each time frame. The "zero" line in the indciator is represented by the number 100. For the D1 time frame for instance a max high/low deviation can be 7. This means that highest indicator value is 107 and lowest 93. Here you could set a value 1 so that a buy trade will be valid if the indicator value is above 101 and a sell trade below 99. The lower the time frame the lower the value must be set. For the M5 time frame for instance a max value could be 100.3. Then it would make sence to set a value of 0.05.
- Enable trend moving average - 'true' or 'false'. When set to 'true' then trades will only be placed if the price is above/below the MA.
- * Enable supply/demand - *** this option will not be used in multi symbol mode *** 'true' or 'false'. When set to 'true' the price must be at a demand zone in order for a buy trade to be valid and at a supply zone in order for a sell trade to be valid.
- * Enable RSI (0=disabled) - Setting a positive value, for instance 30, means that the price must be above or equal to 70 (100-30) for a sell trade to be valid and below or equal to 30 for a buy trade to be valid. Setting a negative value, for instance -45, means that the price must be above or equal to 55 (100-45) for a buy trade to be valid and below or equal to 45 for a sell trade to be valid.
- ADX/RSI/MOMENTUM FILTER SETTINGS
- ADX level (main line) - setting a negative value means that ADX must be below this level in order for a trade to be valid. So if you for instance set the value -25 then ADX must be below 25, or above 25 if you have set the value to 25.
- Period
- * HEIKEN ASHI SMOOTHED SETTINGS
- MA method
- MA period
- MA 2 method
- MA 2 period
- MA time frame
- TREND MOVING AVERAGE (MA) SETTINGS
- MA period
- MA method
- MA time frame
- SIGNAL MOVING AVERAGE (MA) SETTINGS (distances are in points)
- Signal moving average periods - MA2 must be larger then MA1 and MA3 larger than MA2.
- Signal moving average shifts - Default values are 0. You could for instance simulate the Alligator oscillator by using other values for Period and Shift. The shift simply moves the value of the MA in time. So the MA value for bar 0 with shift 1 is the same as the MA value for bar 1. So shift effectively makes the lag of the indicator worse. Negative values are not supported. Of course negative values of shift reduce the lag, but this only looks good historically because the latest value cannot be calculated.
- Signal MA methods - Default is Exponential (EMA).
- MA price type - Valid for both trend and signal MA.
- * Strict mode: 'true' or 'false'. By setting this to ' false' will allow the third MA to be above/below the second MA. Example: We have a triple MA setup with MA 5, 13 and 20. In the normal situation, for a bullish signal to be valid, MA 5 must be above both MA 13 and MA 20 and MA 13 must be above MA 20. In the non strict mode MA 20 is allowed to be above MA 13. Vice verse for a bearish signal.
- Min. distance between MA:s (<0=ADR%, >0=points, 0=disabled) - When using the Triple MA strategy this value should not be set to 0. Recommended is to wait until a certain distance between the 3 MA:s has been reached (all 3 MAs in consecutive alignment). For instance 50 points. The value given here will also be used for the double MA crossover strategy in order to avoid "flat" crosses. Here could be enough to set the value to for instance 5 (points).
- Max. distance between MA:s (0=disabled) - Will prevent opening a trade if the distance is to big. For instance after a news event.
- HULL MOVING AVERAGE SETTINGS
- Period - Moving average period.
- Speed - Smoothening ratio.
- Candle shift - Default is 1. Can be set to 0 to catch the color change one candle earlier (unconfirmed signal).
- Price type
- Time frame (only used with exit method)
- * Max. offset from trend MA (0=disabled) - Max offset in points of the Hull MA from the Hull trend MA.
- * Use price instead of Hull value - Use the price of the last closed candle instead of the Hull MA value when checking the offset from the trend MA.
- * Same color (trend and crossover) - 'true' or 'false'. Setting it to 'true' means that the color of the trend MA (or the slow MA in case of 2 MA cross strategy) must have the same color as the signal MA
- HEIKEN ASHI SMOOTHED SETTINGS
- MA method
- MA period
- MA 2 method
- MA 2 period
- Time frame (only used with exit method)
- SUPPLY/DEMAND SETTINGS
- Enable drawing of supply/demand zones - 'true' or 'false'. The EA is only drawing the zones. There is not trade logic. It is just as a help in case a trader would like to manually intervene with a trade in case the price is approaching a zone.
- * Max bars to look for zone - Default is 2000. Can be set to a lower value in order to reduce the testing time in the strategy tester. It will mean some fewer trades though.
- Min. amount of bars for zone - Default is 10. The higher the value the stronger zone.
- Speed [0.5-4.9] - Default is 1.5. The higher the value the stronger the zone. Higher value = fewer zones.
- * Depth [1-5] - Default is 3. The lower the value the stronger the zone. Lower value = fewer zones.
- Show old zones - 'true' or 'false'.
- Amount of allowed zone tests (-1=disabled) - Will be used with Additional condition set to 'Supply/demand' in the Averaging section, hence Averaging mus be enabled.
- Ignore wicks for zone break - 'true' or 'false'. If set to 'true' then the zone will still be regarded as active even if high/low price was above/below the zone.
- Volume average period (0=volume filter disabled) - If you will use this filter then recommended value is 20.
- Volume over average (percent) - Default is 20. If the volume on the base candle is over the average by 20% or more then the zone is valid. The higher the value the more reliable the setup.
- AVERAGING SETTINGS *** averaging will never be used in Multi symbol mode ***
- ** Enable averaging (PIN code, 0=disabled) - The condition for retrieving the PIN code for activation of this function is that you will contact me via a private message here on MQL5.
- * Enable averaging - 'true' or 'false'.
- Show information panel (not in tester)
- Time frame (candle close) or exact distance - If set to a time frame then there must be a new candle for the selected time frame and minimum distance reached in order for an averaging order to be opened.
- Additional condition for averaging order - Listbox from where you can select from the following options:
- Disabled
- supply/demand - Based on my Supply/demand zone indicator (MT4 / MT5). The price must have touched a supply/demand zone on the chart time frame and minimum distance must have been reached in order for an averaging order to be opened.
- First averaging order distance (0=disabled) - Value in points. You can set another value than 0 here if you for instance would like the first averaging order to have a larger distance than the following averaging orders.
- Min. distance for next orders (<0 = ADR %) - Positive values are in points. If you use a negative value here then with the default value the distance must have reached 50 pips (100 / 2) before an averaging order will be opened. This using the example that ADR for the last 60 days is 100 pips.
- Distance multiplier - Default value is 1 which means that the distance for next averaging orders will always remain the same. If you put here for instance 1.5, and have distance set to for instance 200 (points) in the parameter above, then the next order will be opened when a 300 points distance has been reached (200 * 1.5). The next order again at 450 points (300 * 1.5) and so on.
- Lot increase (<0=multiplier, >0=increment) - If negative value and set to for instance -1.4 then an initial 0.1 lot order will generate a first 0.14 lot averaging order. If positive value and set to for instance 0.02 then the first averaging order will be opened with 0.12 lots. Second 0.14 and so on.
- Profit (<0=money, >0=points, 0=break even) - If the value is set to for instance 10 then the averaging order basket will be closed when in 10 points profit. If negative value and set to -10 the basket will be closed when in 10 in profit in the account currency.
- Maximum amount of averaging orders - If set to for instance 4 then max 4 averaging orders will be opened, in addition to the original order. This means that you will have 5 active orders.
- Virtual TP (always used with Money. Must beTrue for FIFO) - If set to True a green line will appear at the basket close level. If False then all orders will have a broker TP. If 'Take profit method' is set to MONEY (negative value in the 'Profit' input parameter above) then there green line will not be drawn on the chart.
- Close all orders when reached max orders - All orders will be closed when the last order has been opened and the price has moved yet a distance unit.
- Lock order distance (0=lock order disabled) - Possibility to enable Averaging lock (hedge) order. If this is set to a higher value than 0 and the maximal number of grid levels have been opened, and the price moves another distance points against the basket, the EA will open the lock order (in the opposite direction) which makes the whole position neutral and removes all take-profits. Hence the loss amount of the time when the lock order was opened will stay the same since the lot sise of the lock order will be the same as the sum of the lots for the already opened orders. After that the EA does nothing and the trader will have to manually deal with the trades.
- CHART OBJECTS
- * Draw indicators on chart - 'true' or 'false'. Will draw the MA lines on the chart or add the Heiken Ashi Smoothed indicator in a sub window.
- ** Draw moving average lines on chart (0=disabled) - If you set a higher value than 0 then the MA Lines (except for HULL MA) will be drawn this amount of bars back in time.
- ** Color for MA lines
- Show information panel on chart - 'true' or 'false'. Will show status information in a panel in the upper left corner of the chart. The panel can be moved with the mouse.
- Info panel auto colors - 'true' or 'false'. If set to true the the colors will adjust automatically according to the chart background color.
- Info panel background color
- Info panel border color
- Info panel caption color
- Info panel text color
- Line color for ATR
- Line thickness for ATR
- Clear objects on chart - 'true' or 'false'. If set to 'true' then the ATR1 lines (if this option has been enabled) will be removed from the chart upon reinitializing of the EA.
- ALERTS (if alert instead of trade is enabled) - Set to 'true' for each alert type you would like to use.
- EA SETTINGS
- Order comment - Default is "Triple MA". The time frame will be added to the end of the comment. For instance "Triple MA H4".
- Magic number - If using the EA on the same symbol on multiple charts (typically with different time frames) then it is important that the Magic number parameter has a different value. If not then trades on the same symbol will interfere with eachother.
- Global variable prefix - will create global variables with this text as prefix. When values are <> 0 then the EA will use these values on a global level and by doing that overriding the corresponding settings on each chart where the EA has been loaded. At the moment it is possible to use it for lot size, virtual TP, max positons and one trade per symbol and direction.
Minimum necessary parameters for backtesting the Triple MA strategy (MT5 version)
Weekdays to trade [1-Mon..7-Sun]Start hour [0-23]
Stop hour [0-23]
Exit method - including all the settings involved for each exit method. Last step should be set to 'ATR stop loss
Take profit method - including all the settings involved for each Take profit method. Last step should be set to 'ATR trailing take profit'
Enable trend moving average
Enable RSI (0=disabled)
Period
MA period
MA method
MA time frame
Signal moving average periods
Signal MA methods
Min. distance between MA:s (<0=ADR%, >0=points, 0=disabled) - Please use negative value (ADR)