EG104 EA, originally ExpandGrid, is a collection of grid styles/modes that have been optimized by intense tests, results from demos and real accounts and results from studies and parameter variations. It is delivered with the default parameters selected for the best EA results, so the trader does not need to change them to use the EA, just drop it to the chart, and let it play.
It has been found, during demoing EG and by users of forexfactory.com forum that a management of modes during news releases may increase profitability, decrease risk and salvage small accounts.
The idea behind EG is to create a grid above and below the price at an optimal pips increments, open a cycle and target it at one grid level. That it is. If the start lot quantity is 0.10 on EURUSD and grid level is 10 pips, then grid target is $10.00. If the trade goes south, EG will use different styles/modes to accumulate positions and average down or reverse the breakeven point and then target its original goal of $10.00. If at a preset level, the target is not reached, EG will set the cycle to a closure mode targeting the breakeven point. After a cycle is closed, EG will start a new cycle.
This EA works with its default values out of the box, but flexibility has always been a priority in developing it. It means the trader may change default values and use different grid modes simultaneously. By using start/end times the EA may run one grid mode during active sessions and a different grid mode during sleeping sessions, it may run modes in parallel or interlaced and with its own set of parameters. The trader is able, by combining these modes, to create a well complex algorithm no one created before. Its flexibility creates its unlimited potential by itself or by the trader’s imagination.
As a summary, there are two types of grid modes, stop order mode and limit order mode. It has been found that when the market is trading normally or in a range environment, limit orders style works better in a grid (buy below price, sell above price) and when the market is trending or moving fast and far up and down away of regular movements, stop orders work better. (Buy above price, sell below price).
Stop order mode reverse the breakeven point multiplying the opposite quantity by a factor (multiplier), limit order mode accumulates at the original trade direction averaging down the breakeven point by multiplying the last order quantity by a factor (multiplier). There are modes that use a static grid and others use a floating grid where the center moves as new orders are executed. Combining a stop order style with a limit order style, with a moving grid, creates a very interesting scenario. I challenge you to test it.
Grid modes:
- symmetry-hedge- limit order mode. it buys and sells simultaneously, closing winning positions at grid levels and averaging breakeven points of losing positions by an order quantity multiplier. The center of the grid moves as new orders execute.
- Channel-static - is a stop order mode. it buys and sells simultaneously, the EA multiply quantity by a multiplier and open positions on the opposite direction. the center of the grid does not move creating a static channel.
- Channel-floating - same as Channel-static where the difference is the center of the grid that moves as new orders execute.
Parameters:
- s_MagicNumber/c_MagicNumber: Set magic number to a value greater than zero to enable the style/mode. MagicNumber is used to identify modes. It must be a different value for each mode. s for symmetry, c for channel.
- s_StartLotQty/c_StartLotQty: Is the initial order lot quantity, additional orders will use a multiple of this value. The default is 0.01.
- s_WeightQtyMulti=1: In symmetry mode, when this parameter is greater than 1, the EA will use its proprietary formulas to weight direction. If EA calculates long direction, it will multiply long s_StartLotQty by s_WeighQtyMulti for all buy orders, if it calculates short direction, it will multiply the sell orders. if the direction is unknown, none direction will be multiplied. Example, if s_WeightQtyMulti = 2 and the EA defines long and s_StartLotQty=0.01, the EA will enter 0.02 for buys and 0.01 for sells.
- s_GridSizePips/c_GridSizePips: the size/distance of the grid levels in pips. If Grid_Increments and Grid_Factor are used, GridSizePips will take precedence.
- s_GridSizeFactor/c_GridSizeFactor: When GridSizePips=0, a value from 1 to 15 can be used to calculate the grid size/distance. A small value increases the grid size and does open fewer orders, biggest values decrease grid size and scalp more. I see it as a scalping intensity level. Grid size will be calculated by using daily ATR or daily range values, divided by Grid_Factor. When GridSizeFactor and GridSizePips are both zero, ExpandGrid will use the spread in pips (not points) as grid size.
- s_OrderMultiplier: in symmetry mode, the value used to multiply next order quantity.
- s_AccumulationFiltered=true: Delay accumulation order execution by M1 fractals and M1 moving average cross over. The true value is recommended to pause execution on news releases or fast market moves.
- c_ChannelMultiplier: Order multiplier for Channel mode. It is used when price touches opposite direction of the grid.
- s_StartTime/s_EndTime, c_StartTime/c_EndTime: ExpandGrid will not open new cycles outside the time specified. Opened cycles will continue executing.
- c_ChannelType: Channel-static - is an stop order style. the EA multiply the quantity by a multiplier and open positions in the opposite direction. the center of the grid does not move creating a static channel. Channel-floating - same as Channel-static where the difference is the center of the grid that moves as new orders execute.
- TakeProfit: I do recommend keeping this value as zero (default).
- ProfitLevels=1: Use this parameter to override profit target in levels. Default is 1.
- Exit_By_M1MA=false: When this parameter is true, the EA will check first its profit target and second the mean price related to a M1 moving average. If cycle is long and price trade above M1 MA the cycle will not close. If cycle is short and price trade below M1 MA the cycle will not close. The EA will try to maximize profits.
- GridFactorMethod: Range_20day to use 20day range average, ATR_20day to use ATR 20 days to calculate grid distance/size when GridFactor parameter is used.
- PipsOffset=1: Exit order offset in pips. It is used to address latency and order execution delay. I do recommend its default value of one.
- Max_Money_Loss: Maximum money loss per grid style. It is recommended to keep it at zero (disabled)
- MaximunOrders=0: When this parameter has a value greater than zero, the EA will pause trading if accumulation orders are greater than its value.
- NeutralizeBalancePercent=0: Now a grid cycle can neutralize/hedge by EG104 NeutralizeBalancePercent, the default value is recommended. If you use this parameter, I do recommend values greater than 60%
- Expansion_Percent: Grid increasing/expanding percentage, the default is 20.
- FlatOnFriday: Will set the target to 0.01 and stops creating new cycles on Fridays after 14 GMT Hours.
- TimeToUse: Time EG104 will use when starttime/endtime is used.
- ResumeNTZd=false. When this parameter is false, after the cycle is neutralized/hedged, the EA will pause execution. You must continue trading manually or using TradingLines. When this parameter is true, the EA will continue trading as normal, closing and opening orders at it levels. If NeutralizeBalancePercent has a value, you may get multiple neutralization/profit taking orders. This scenario may expand the recovery zone and make the cycle look like it is losing more money.
- CONTINUE: It will open new grid cycle after targeted, if this parameter is set to false, the EA will stop the grid after all the positions close. ExpandGrid will continue managing opened positions.
I do continue testing and demoing this EA with the goal of finding the smaller drawdown and the best profit factor.
I do recommend checking the post 1 (this post) periodically and always check for the file uploaded date and compare it with your copy, also, when the change is significant, I do increase the version level. It is also recommended for you to keep the older copy in case you want to go back on any release.
To have files organized and to not confuse releases, I will upload EA files to post 1 only.
You all are welcome to this thread and allowed to post comments here, and it is also advised that EG has commercial intentions, the reason it is in the commercial area of this forum.
Risk disclosure: This EA is designed as instructional and illustration purposes only and it should be tested and demoed only. If you trade it live, you are doing so at your own risk and I am NOT TAKING LIABILITY if you lose your money.
==============================================================
Relevant posts:
Post 207
symmetry in action video here
Post 1,026: Trading with lines
Post 1 111 : Calculate minimum balance required
Post 1 169 : Lot Quantity recommendations.
Post 1,178: The meaning of the lines
Post 1204: Closure Mode
How to measure pips?
The Meaning of I-MinLot AvailableLots
Dynamic Grid Explained
Contract Size
EG104v032 initial rules
symmetry 034 explained
How to use i-MinLot script?
Version 035? Please Read:
Version 038?
Post 2,847
Please post your results,
Thanks, bauta
Download files below to following locations:
...\MQL4\Experts\
EG104.ex4
...\MQL4\Scripts
ApplySettingsToAll.ex4
i-MinLot.ex4
Current Release: EG104 v038 (11/11/2017)