This pair trading robot for any correlated symbols independently determines trade direction and a trading sector. It is insensitive to connection losses and critical price movements. It is attached to a chart of the first symbol (of a pair) on M30. The robot cannot be tested in MT4, as the algorithm involves simultaneous operation on different symbols.
Inputs of Octopus Arbitrage:
- MagicNumber - parameter necessary to ensure operation of several EAs on one account without let or hindrance
Attention! You can work with several correlated pairs on one account, but EAs must be launched in different terminals. This restriction is caused by peculiarities of MetaTrader.
- Pair_1 - currency pair 1, EURUSD by default
- Pair_2 - currency pair 2, GBPUSD by default
- LossInPoints - loss of the last open pair of orders. The next pair is opened when reaching this loss.
- ProfitInPoints - profit in points for the pair of the last opened orders
- TrailStop - deviation in points to place stop loss
- TrailStep - trailing step
- StoplossRatio - profit percentage (set in tenths), we would like to fix when placing a stop. See stopLossType
- MinStopLoss - minimum allowed price deviation in points (see stopLossType)
- Slippage - slippage in points
- TotalProfProc - total profit of all open positions as percentage of the balance. All positions will be closed when this value is reached
- MarginLimProc - minimum percentage of your free margin to control funds involved into trading.
- OrdersComment - comments to the EA's orders
- MZ - parameter responsible for EA operation start time (800-1500p. for 5 digit quotes).
- MZ_UP - silent zone above zero (positive)
- MZ_DOWN - silent zone below zero (negative)
- Amnesia - if set to "true", the "amnesia mode" is enabled. That means that when the last order (the last open order for the given direction of the correlation divergence) is reached, stop loss is placed but not trailed until all other orders of this group are closed. That allows to compensate negative profit for the opposite order group in case of the oppositely directed movement and to avoid significant drawdowns.
- DBG_FLAG - record the debug information in the log file. Required for performing tests and control. We recommend to set this parameter to 0, as logs are recorded within minutes and occupy a lot of drive space. So if you need to enable them, you should clear logs manually.
- CloseAll - if set to 1, all currently opened orders will be closed (you can use it for fast closure of a huge amount of open positions if necessary).
- L1, L2 - lot size for the 1st and the 2nd pair correspondingly. coeflots=1 means just a lot size. If coeflots>1, size of an initial lot for a group of orders.
- coeflots - growth speed of lots.
- Max_Lots_lim1, Max_Lots_lim2 - maximum size of a lot for the first and the second symbol.
- lotCountRepeat - how many order pairs will be opened with this lot.
- lotInc1 - value to increase the lot of the pair 1 (EURUSD),
- lotInc2 - value to increase the lot of the pair 2 (GBPUSD).
- StopOrdersMode - enable pending order mode.
- TSO - Trail Stop Order (see StopOrdersMode)
- TSS - Trail Stop Order Step (see StopOrdersMode)
- Anti - if set to true, the "anti-octopus" mode is enabled. I.e. a "converse" trading begins. In a situation where the EA would normally place a Buy order, it will place a Sell order
- UseRegression - enables the mode of "using regression when correlation converges". The main idea is to open pairs only when the correlation (indicator) starts converging again.
- min_a_up and min_a_down - degree of correlation convergence (see UseRegression). The bigger the value, the "heavier" it starts converging again. UP and DOWN for the lower and the upper part of the chart correspondingly
- RegDeep_up and RegDeep_down - it also referred to the UseRegression mode. It shows number of bars on the correlation indicator which will be used for calculation min_a_up and min_a_down. It usually uses 4 bars
Max Trade - maximum amount of opened pairs. After reaching the specified value, the EA waits till the last pairs are closed. If the correlation is broken again, the EA adds new pairs till the specified limitation is reached.
LossInPointsCoeff* - change ratio of the divergence value necessary for opening additional orders (placing pending orders).