🤖 EA name: Generic Martingale (FT)
📦 Version: 14.03.91
💻 Platform: MT4
📈 Strategy: Order grid and Martingale
⏰ Timeframe: M15 – H4
🌍 Currency pairs: AUDCAD, EURGBP, NZDCAD, USDCAD and other
🌓 Trading time: Around the clock
📊 Monitorings: https://www.myfxbook.com/members/Serg163/generic-martingale/2346282

⏳ Test period: 2018.03.01 – 2023.05.05
🏛 Tick Data Provider: Dukascopy (TDSv2)
Real spread: ✅
Slippage: ❌

In order to download an adviser with tests, go to our telegram channel 👇


Job description of a trading advisor

An upgraded version of the well-known Generic TLP, a profitable night scalping EA with the function of building a grid in both directions and a martingale. The network of orders is built dynamically when the BB channel crosses with a sufficient minimum distance between orders, calculated using the Meta Trader 4 – ATR indicator.

A distinctive feature of this profitable MT-4 Martingale grid Expert Advisor is the very accurate entries of the first order based on Generic signals, which reduces the risk of excessive construction of a grid of orders and increases the chance of closing the grid of orders as soon as possible, rather than increasing the drawdown on the call margin or stop out.

There is a breakeven, setting a decrease in take profit with each new knee of the grid of orders, averaging after N knees of the grid of orders, recalculation of take profit when calculating the swap, partial closing of the grid of orders, trailing. Filters for trading equidirectional pairs, entry restriction with a large drawdown value, filter for the maximum number of pairs in the market.

Description of Expert Advisor order grid and martingale settings

<==== GENERAL SETTINGS ====>

Set NameThe name of the set file.
Magic NumberMagic number of the adviser.
Slippage slippage in old paragraphs.
Lot Fixed lot size with which the EA will open orders.
DepoPer001Lot AutoMM value, set in the size of the allotted deposit for 0.01 lot.
Take ProfitFixed take profit size, in points.
Dynamic TP: Channel PercentTake Profit is calculated as a specified percentage of the width of the current channel of the Bollinger Bands indicator. When opening a new order, Dynamic TP is recalculated. If the parameter value = 0, the TP size is taken from Take Profit.
Dynamic TP: Min SizeThe minimum take profit size when using the Dynamic TP: Channel Percent parameter, in points.
TrailingStartLevelknee number from which trailing of all grid orders starts.

TrailingStep trailing step between the current price and the SL. If the trail starts with 1 knee, then the step must be more than 10 pp, otherwise there is an option to open a large number of transactions due to a sharp price movement.

<==== Extra Settings====>

StopOpenNewOrders If set to true, the EA will stop opening orders for a pair that is not yet in the market.
Max SpreadThe maximum allowable spread in points above which the EA will not open orders until the spread stabilizes. Valid for the entire network.
Stop LossStop Loss in points (set for the entire basket). At 0 – off.
ExitDDPercent percentage of drawdown at which all orders for this pair will be forced to close. At 0 – off. Example: If EURUSD has 10 buy trades and 2 sell trades, but the total drawdown is greater than ExitDDPercent %, all EURUSD orders are closed forcibly.
StopByMaxDD %percentage of drawdown, upon reaching which the EA will not open a new grid.
StopByMaxDD: Allow Opposite Enterif true, then if the drawdown exceeds StopByMaxDD %, the entry of opposite orders on the same pair is allowed. Those. if the grid in the market is in the red for a buy, then we allow you to enter a sell (a kind of hedging).
StopByMaxSymbolTrades the filter controls the maximum number of trading pairs allowed in the market at the same time.
StopEqualCurrencyTrade the filter controls unidirectional trading pairs in the market and prohibits entering them. If StopEqualCurrencyTrade = 1, and there is an open buy trade for EURUSD, then EURCAD will not be opened for buy. If StopEqualCurrencyTrade = 2, and there is an open buy trade for EURUSD, then EURCAD will open for buy, and the third pair, for example EURAUD, is gone.
StopEqualCurrencyDelay arbitrary delay before checking the currency filter from 0 to 10 seconds. Needed to avoid entry by the second pair if signals appear on one tick for two unidirectional pairs.

CurrencyTradeMaxHoursTime in hours after which the currency filter stops working. At 0 – off. Those. if we have a grid hanging in the market for more than 24 hours, let’s say, then we assume that entering a unidirectional pair is no longer so scary, that two grids will not stretch so much (hypothetically) and we ignore the filter. Useful when you don’t want 2 couples in one Asian session, but you allow it the next day.

<==== ENTER SETTINGS ====>
<== Bollinger Bands Settings ==>

BB: PeriodBollinger Bands MT-4 indicator period.
BB: DeviationDeviation of the Bollinger Bands MT-4 indicator.
BB: DeltaIndent from the borders of the Bollinger Bands MT-4 indicator channel, in points. It may be on both sides.
BB: Min Channel WidthThe minimum width of the Bollinger Bands channel at which the EA is allowed to trade, in points.


<== CCI Settings ==>

CCI: PeriodCommodity Channel Index MT-4 indicator period. If 0 – no signal is taken from the indicator.
CCI: LevelCommodity Channel Index MT-4 indicator level. Calculated for opposite signs. Those. with CCI: Level = 100, levels 100 and -100 will be taken.


<== Candle Size Filter ==>

UseMaxCandleForAllOrders – check the candle filter for each grid order. If False – disabled.
Max Candle Size – The maximum size of the sum of the lengths of N last candles (from High to Low), above which the EA will not open new orders.
Bars For Analyze – The number of last candles on the chart to analyze the size of the candle. The countdown starts from [1] candle.

<==== GRID SETTINGS ====>

ATR Period for DistanceATR MT-4 indicator period for calculating the minimum allowable distance between grid orders.
ATR Multipliermultiplier for the value of the ATR indicator MT-4.
Multiplier 3 levellot multiplier only for the third knee of the grid. The second knee always opens with the original lot.
Multiplier > 3 level mesh lot multiplier, starting from 4th generation.
Same Grid Orders Lot Size number of consecutive orders with the same lot size. If the value is less than 2 – off and the calculation proceeds as before.
example:
Multiplier>3 level = 2, Same Grid Orders Lot Size = 2: 0.01-0.01-0.02-0.02-0.04-0.04-0.08-0.08-…
Multiplier>3 level = 2, Same Grid Orders Lot Size = 3: 0.01-0.01-0.01-0.02-0.02-0.02-0.04-0.04-0.04-0.08-0.08-0.08-…

TPDecreasePercentparameter to reduce mesh TP by a given percentage each time a new knee is opened. For example, if Take Profit = 50pp, TPDecreasePercent = 10%, then the TP of the first order will be 50pp, the second – 45pp, the third – 40pp, etc.
Breakeven Levelthe number of the knee from which the TP of the grid is transferred to breakeven. When transferring, the swap and the commission of already open orders plus 0.1 pip are taken into account.
Breakeven Stepindent from the BU level in old points. (used to compensate for swaps and commissions when transferring time-consuming grids to BU)
Breakeven Include Swap and Commissiontake into account swap and commission when calculating BU and TP.
Averaging_Level knee number at which the lot stops multiplying by the multiplier and is set equal to the last opened one.

<==== Grid Extra Close Settings ====>

Part Close Levelknee number from which the EA will start checking the income and drawdown of the very first order specified in the settings. If 0 or 1 – the parameter is disabled.

Part Close Profit Percentpercentage of income between 1 and Part Close Level orders, after which the EA will close these both orders. Those. if the account balance is $1000, the percentage is Part Close Profit Percent=1 (i.e. $10) and the drawdown of the first order is -40$, and the profit of the Part Close Level of the order is 50, then 50-40 = 10 which is equal to our percentage closing and we cover these orders. The closing percentage can be negative, i.e. at -1, when we have the first order = -50, and the fifth order is 40, then in total it is -10 – we cut into a small minus.
Further, after these orders are closed, two less orders remain in the market. The EA recalculates the targets of the remaining orders and continues to trade according to its system. After opening the next Part Close Level order, the EA starts checking this filter again for the possibility of closing a new first order and the last one.

<==== EXIT SETTINGS ====>

Exit Profit PercentThe percentage of the take profit, upon reaching which 4 filters start working to exit the position.
Exit BB Filter: Out Channel Distance Distance from the opposite border of the BB indicator channel in points, upon reaching which the closure will occur. If the parameter value = 0 – disabled.
Exit CCI Filter: PeriodThe period of the Commodity Channel Index indicator for forced closing when the opposite signal of the indicator appears.
Exit MA Filter: Period The period of the Moving Average MT-4 indicator, upon changing the direction of which a forced closure will occur.
Exit Time Filter: MinutesThe number of minutes from the last order, after which a forced closing in plus will occur.

<==== 1 ORDER TRADE TIME FILTER ====> – parameters are valid only for the first grid order

GMT Offset Offset in time relative to the broker’s GMT, in hours. Attached sets were optimized for GMT+2. If your broker has a different GMT value, set the correct value. For example, if you have GMT+1, then GMT Offset = -1. If you use your own sets, you do not need to change the setting.
Start Trade HourHour to start trading.
Start Trade MinuteMinutes to start trading.
End Trade HourEnd trade hour.
End Trade MinuteMinutes for the end of trading.

<==== 1 ORDER ROLLOVER FILTER ====> – parameters are valid only for the first grid order

Rollover FilterIf true, the filter is enabled.
Start Rollover HourThe hour the filter starts to work.
Start Rollover MinuteMinutes of the start of the filter.
End Rollover HourEnd hour of the filter.
End Rollover MinuteThe minute the filter ends.

<==== OTHER SETTINGS ====>

Show Panel If true, a graphical panel with information will be displayed on the chart with the adviser.
Show Signal Points If true, lines will be displayed on each candle of the chart with the Expert Advisor as fixed values of the Bollinger Bands +/-Delta indicator channel.
Panel ColorColor of the graphical panel.
Logging ModeLogging mode: all records (All), only errors (Only Errors), nothing (Off).
Write Log FileIf true, the EA will create a text file with EA logs. Location in the terminal data directory: MQL4 –> Files (when trading), Tester –> Files (when testing).

Conclusions on the order grid and martingale trading advisor

Expert Advisor order grid and martingale – Generic Martingale trades daily, but the main signal to open orders comes only at night during the Asian trading session, which in turn guarantees entry only at the best prices. Daily trading, without restrictions on the days of the week, allows you to diversify the risk and avoid re-optimization of the trading system based on historical data.


In order to download an adviser with tests, go to our telegram channel 👇

Leave a Reply