This is a fully automated multi-currency Expert Advisor with unlimited number of currency pairs using MACD and Envelopes indicators. You can specify how the EA should work with each currency pair. You can add orders manually.
- OrderPanel: display the panel for opening orders.
- TradeToBalance: target balance to stop trading. The parameter is triggered only after all trades are closed. Otherwise, it continues opening orders to return to normal before closing deals according to one of the conditions below. 0 - trade with no limits.
- Magic: Magic number of orders opened by the EA.
- MagicNumber: If OWN, work only with orders having its own Magic number, ALL - work with all orders of the currency pairs set in TheMainPair.
- TheMainPair: Currency instruments (pairs) for the EA to work with. There may be variations when setting a pair. If set simply as EURUSD, GBPUSD: or AUDUSD:ALL, the EA opens both buy and sell orders. If a specific order type is set after a colon USDJPY:BUY, then the EA opens only buy orders and in case of eurjpy:sell, it performs only sell orders. The pairs are separated by commas. For example, the following entry "EURUSD, GBPUSD:, AUDUSD:ALL, USDJPY:BUY, eurjpy:sell" instructs the EA to open trades on EURUSD, GBPUSD and AUDUSD in both directions, while trades on USDJPY and EURJPY are opened only in specified directions. (If the parameter is left blank, the EA trades in both directions on the pair it is launched at)
- Trading: type of trading, Netting or Standard in the directions specified in TheMainPair.
- MACDfastEMA: Fast EMA Period.
- MACDslowEMA: Slow EMA Period.
- MACDsigLine: Signal SMA Period.
- MACDprice: select one of the price options.
- MACDnoOpen: the number of points from 0 to not open positions.
- iBarLook: number of bars to look back for comparison. Refers to both indicators. There is no need to set a large value. The optimal ones are 1-3.
- EnvelopesPeriod: period.
- EnvelopesShift: MA shift.
- EnvelopesPrice: select one of the price options.
- EnvelopesDeviation: deviation (in percent).
Working with Orders
- TakingOrders: allow opening orders.
- MaxSpred: maximum allowable spread to open trades. 0 - any.
- Deviation: default slippage.
- StepPips: distance to the next order in pips.
- OrdersTake: the maximum number of open trades in one direction for one currency pair.
- PauseMinute: pause in minutes when closing all orders.
- StopLossOrder: stop loss when opening an order. **
- TakeProfitOrder: take profit when opening an order. **
- TypeLot: Fixed - fixed, Floating - floating Lot+PlusLot, Percent - percentage of the balance.
- Lot: lot size; if Percent is used, specify the percentage.
- PlusLot: lot size is added to the next order, +PlusLot.
- MaxLot: maximum lot, limits when using Floating and Percent.
Working with a loss-making order
- MenuMinusOrder: lot to be closed; if 0, then close fully.
- MinusProfitFactor: * for the negative order, Lot*X. **
- LockMinusProfitFactor: * for covering the negative order, Lot*X.
Stop Loss when tracking for profitable market orders
(All stop losses should not be lower than allowed by STOPLEVEL)
- SecCheckStop: the minimum number of seconds to modify Stop Loss/Take Profit.
- InterestOrderP: breakeven percentage for profitable orders. **
- MinStopLoss: minimum stop loss for profitable orders. **
- TakeProfitOrderMod: take profit for modified orders. **
- ProfitFactor: * for all orders (average Lot*X). **
- PairFactor: * for the currency pair during rollbacks (average Lot*X). **
- PairHeadingFactor: * for the currency pair direction during rollbacks (average Lot*X). **
- OrderProfitFactor: * for profitable orders during rollbacks. **
- AnalysisBool: trading mode based on the database.
- AnalysisTrainingBool: enable training.
- AnalysisOrders: the maximum number of orders in the database, 0 - unlimited.
- AnalysisBar: the number of bars to process, min:5, max:500.
- AnalysisProfit: profit of an order to add it to the trading database (pips).
- AnalysisMinus: loss of an order to remove it from the database (pips).
* - profit multiplier
** - if 0, disabled/not used/not taken
Implemented as the MinusLotClose parameter.
2. Added the ability to trade with preliminary analysis of trades. It creates a custom database of successful virtual orders. And if the corresponding parameters are met in the future, a trade order is opened.
2. Added a panel for opening trading orders for currency pairs allowed for the EA operation.
3. Added a parameter allowing/prohibiting order opening. So now t is possible to run multiple EA instances on currency pairs with different settings and to perform general multicurrency monitoring if necessary.
4. New Trading parameter has been added - it instructs the EA the mode of operation with currency pairs selected in "TheMainPair".
This parameter is convenient for use on accounts where hedging is prohibited. If set to "Netting", you should take into account that there should be an even number of currency pairs, and each pair should be appropriate for hedging when working in different directions.
5. The formula for calculating the profit when closing all orders has slightly changed. Now the coefficient of the total number of orders is used.
Total_profit_of_orders > Lot_of_all_orders/Total_number_of_orders*(Total_number_of_orders/10+1)*ProfitFactor
The number of points from 0 to not open positions.
It sets the corridor, where it is not allowed to place orders between zero and the value of the MACD indicator.
For BUY below 0, for SELL above zero, respectively.
The MACD value in points is specified. Example
MACDnoOpen = 25
for a 5-digit currency pair, it will be 0.000025, for 3 digits - 0.0025 and so on. This is due to the fact that Digits of the MACD indicator is equal to Digits of the currency pair plus 1.
If the EA is configured for multicurrency trading, the prohibition corridor will be calculated for each currency pair individually, based on the number of decimal places of the MACD indicator for a given pair.