EA Legion

20 September 2021, 22:55
Svyatoslav Kucher
1
176

EA Legion is an automatic advisor that uses order averaging to prevent losses after the price moves in the opposite direction from the initial entry. The main feature of the EA is the ability to open multiple positions, which consist of a series of orders. Each position is monitored, and the advisor can close them upon reaching a profit, based on signals, or all positions together based on total profit. The averaging of series orders itself is also not standard, and consists of lists, there are ten lists in which you can specify the step between orders, lot, number of orders.

  • Recommended currency pairs: AUDNZD, AUDCAD, NZDCAD, GBPCAD, GBPAUD, NZDUSD, EURNZD
  • TimeFrame: M15
  • Test Method: every tick,  open prices only
  • Recommended MM: 0.01 lot per 1000 $ (for one currency pair)

IMPORTANT: for each installed EA version, check the MagicNumberStart and MagicNumberEnd values, they should be different. Also, the range of values ​​between these parameters must be twice the MaximumNumberSerieses parameter.


Virtual balance and lot setting

An important parameter for the EA operation is the VirtualBalance parameter, if you have chosen a floating lot, then with each increase in the deposit by the VirtualBalance value, the lot size of the first order (FirstLot) will increase, as well as the lot size specified in each list of orders. The profit/drawdown percentage is also calculated and depends on the VirtualBalance value. For example, let's say that a floating lot size of 0.01 is selected, closing at a profit/drawdown percentage of 20, and VirtualBalance = 10,000, this means that when the balance size is 20,000, the first order will be opened with 0.02 lot, and all series will be closed at a profit/drawdown of 4,000.


Additional orders

After the price moves in the opposite direction from the opening of the first order, the next orders will be opened through the specified step in the first list of orders, their number is determined by the Orders number parameter. Imagine that Orders step = 50, Orders lot = 0.2, Orders number = 10 , Based on this, after the price hike 50 points from the first order of the position, the first order from the list will be opened with a lot of 0.2, then, as the price moves, every 50 points, orders will be opened with the same lot. After 10 orders are opened and the price has passed the distance specified in the second list in the Orders step parameter, orders will be opened according to the conditions specified in the second list of orders, etc.



Testing and optimization

The Expert Advisor was developed in such a way that it can be quickly set up and tested, therefore all the main actions for opening and closing orders take place at the opening of a new bar. EA Legion can be tested and optimized using the "Every Tick" and "Open prices only" method.

The parameters for searching for an entry signal can be optimized by immediately specifying the number of allowed series in the MaximumNumberSerieses parameter, and as an example, the parameters in the screenshot below:

You can also customize the signal by specifying  , set its own signal calculation period and entry level for each series, as below:

Sensitivity, SensitivityPeriod are important parameters for the strategy, they also need to be adjusted. After this optimization option, the obtained values ​​can be entered into the ManualEntryPeriods and ManualEntryPeriods parameters, specifying the number of allowed series. See example below:

If SensitivityPeriod = 0, SensitivityStep = 0, then the values ​​specified in ManualEntryPeriods are used.


Expert advisor parameters


—————— G E N E R A L   S E T T I N G S ——————

  • LanguageInfo - information output language.
  • MaximumNumberOrders - the maximum number of orders in a series.
  • MaximumNumberSerieses - maximum number of series.
  • TakeProfit - take profit value.
  • StopLoss - stop loss value.
  • MaxSpread - the maximum value of the spread for opening orders.
  • Slippage - slip value.
  • MagicNumberStart - the beginning of the list of magic numbers.
  • MagicNumberEnd - the end of the list of magic numbers.
  • OpenOrderComment - comment to orders.

—————— M O N E Y   S E T T I N G S ——————

  • MMType:
    • FIXED - fixed lot.
    • FLOAT - floating lot .
  • FirstLot - lot size of the first order of the series.
  • VirtualBalance - virtual balance for calculating the lot, with MMType = FLOAT.
  • PercentProfit - profit percentage for closing all series and orders.
  • PercentDrawdown - loss percentage for closing all series and orders.

—————— E N T E R   S E T T I N G S ——————

  • EntryCalculationPeriod - period for calculating the signal.
  • EntryPeriodStep - step of periods.
  • ManualEntryPeriods - manual entry of periods, separated by commas.
  • EntryLevel - input level value, minimum value 10.
  • EntryLevelStep - level step, minimum value 1.
  • ManualEntryLevels - manual entry of levels, separated by commas.
  • SensitivityPeriod - period for calculating the Sensitivity parameter.
  • SensitivityPeriodStep - step of periods.

—————— C L O S E   S E T T I N G S ——————

  • ProfitAccumulator - the counter of the previously accumulated profit, is used to close all series by the total profit.
  • ClosePositionsOnlyProfit - closing only for profit.
  • ClosePositionsByTotalProfit - closing all series for the total profit.
  • TotalPositionsProfit - profit in points for the general closing.
  • ClosePositionsBySignals - closing a series of orders after receiving a signal.
  • ClosePositionsByAverage - closing a series of orders by the average value.
  • ClosePositionsByAverageModi - modification to close
  • AverageSearchPeriod - period to search for a close signal.

—————— A V E R A G I N G  S E T T I N G S ——————

  • ---- profit settings
    • MultiProfitAfter - change the TakeProfit value after the specified order. If 0, it is not applied.
    • MultiProfit - exponent for changing TakeProfit.
    • MinProfit - the minimum allowable TakeProfit value.
  • ---- order list ( 1-10 )
    • Orders step - step of orders.
    • Orders lot - lot of orders.
    • Orders number - the number of orders.


Результаты тестирования с плавающим лотом








Share it with friends: