Multicurrency trading system based on standard indicators. Up to 3 signals of 12 standard indicators can be applied in this Expert Advisor. All indicators have configurable external parameters.
Dear users, you can oder the source code of this Expert Advisor by writing a private message to the author.
Autolot (calculation of volume based on the current balance), money management;
Work by time (limitation of trade time for the Expert Advisor);
Trailing Stop (standard one with the “Only profitable” algorithm);
MarketWatch ECN (work on the ECNNDD groups’ accounts);
Functions of error processing for real accounts;
Block of closing by total profit and loss with the ability to disable all the Expert Advisors on the account;
Break even (moving Stop Losses to the zero level);
Martingale (increasing the following lot after an unprofitable position);
Work by the indicator signals only (Signal for opening, Signal for closing an opposite order and opening);
Closing opposite orders when signal changes;
The “REVERSE” function that reverses the signals of your strategies.
Indicators and Signals
Moving Average (MA) (Signal 1)
The signal is calculated using relative position of two Moving Averages, one of them should have a smaller period (fast ÐœÐ), while the other — a greater one (slow ÐœÐ). Their parameters can be specified in the following variables:
BUY signal appears when the fast ÐœÐ is located higher than the slow one, while SELL signal appears, when the slow MA is higher than the fast MA. “No signal” state is not used.
The signals are also simple: BUY — the main line is higher than the signal one, SELL — the main line is below the signal one. “No signal” is not used.
Stochastic Oscillator (Signal 3)
Oscillator consists of two lines — main and signal ones allowing to trade according to the lines crossing signals. BUY signal — the main line is above the signal one, SELL — the main line is below the signal one.
The RSI indicator (Signal 4)
The indicator is similar to CCI and DeMarker. Exit from the overbought (RSIHighLevel) and the oversold (RSILowLevel) zones are used as an appropriate signal. Therefore, rare BUY signals correspond to crossing the upper level downwards, while SELL signals correspond to crossing the lower level upwards. Main state is “no signal”. The indicator period can be set in the RSIPeriod parameter, while calculation price — in the RSIPrice parameter.
Commodity Channel Index (CCI) (Signal 5)
All three signals are also used, but the main state is still “no signal”. Rare trading signals correspond to crossing the upper level downwards (BUY) and crossing the lower level upwards (SELL). Upper and lower levels are determined by the value of the CCIHighLevel and the CCILowLevel external parameters. Indicator calculation period and price are determined by the CCIPeriod and the CCIPrice values.
Williams Percent Range (WPR) (Signal 6)
The indicator is similar to RSI, CCI and DeMarker. BUY signal — crossing the overbought level (WPRHighLevel) downwards and SELL — crossing the oversold level (WPRLowLevel) upwards. All other cases refer to “no signal” state. Only the indicator period parameter (WPRPeriod) can be changed outside.
Bollinger Bands (Signal 7)
All three types of signals are present: BUY — previous candle close price is below the lower line, SELL — previous candle close price is above the upper line, “no signal” — candle close price between the lines.
The Envelopes indicator (Signal 8)
Since the indicator represents a channel, the signals are similar to the ones when working in the channel: BUY — candle close price is below the lower line, SELL — candle close price is above the upper line while “no signal” — close price between the lines.
Alligator (Signal 9)
Also, the same averaging method (AlligatorMethod) and calculation price (AlligatorPrice) are used for all lines. A distinctive feature of the indicator is that all lines have a positive shift to the right. This allows reading the indicator values on the current bar, as they are complete already and not subject to change. BUY signal — the lips line is higher than the teeth line, while the latter is higher than the jaw line, SELL signal — the lips line is below the teeth line, while the latter is below the jaw line. There is no signal in all other cases.
Moving Average of Oscillator (OsMA) (Signal 10)
The signals are calculated a bit differently: BUY — the histogram value is above zero, SELL — the histogram value is below zero. “No signal” state is observed in those rare cases when OsMA value is equal to zero.
Awesome Oscillator (AO) (Signal 11)
The oscillator has no parameters available to users. One of the principles of working with the indicator is looking for “saucers”. Bill Williams’ “saucer” consists of two increasing bar values in positive area having a bar with lesser value between them. Therefore, “inverted saucer” consists of two decreasing bar values in negative area having a bar with larger value between them. Therefore, three last completed candles (four candles in the code) are needed to detect a “saucer”. BUY signal — “saucer”, SELL signal — “inverted saucer”, “no signal” — all other cases.
CloseProfitLoss=“CloseALL when Profit or LOSS options”;
pair=“Symbols options “;
Description of Parameters
1. Parameter to get a signal bar
shift (0,1,2.….) bar number.
This parameter represents the number of a bar from which your indicators will take signals. Specify the following parameters of signal detection when ordering an Expert Advisor:
Open a deal immediately after the signal appears;
Wait until a signal on the closed bar is formed and open a deal only at opening of the following bar.
Some indicators have a clear definition on what bar a signal is triggered due to their algorithms. Considering the accuracy and correctness of execution of an order, a deal should be processed only on the current bar, i.e. shift=1 parameter. If it is necessary to open the deal immediately on the current bar as the signal appears and the indicator allows it, then you should set shift=0.
2. Reverse of strategy signals
ReverseSignal (true — false) Enabled\Disabled.
This parameter represents the reverse of signals of your indicator(s).
If your Expert Advisor is drawn on a definite algorithm or on definite signals of the indicator, you have a possibility to change BUY\SELL signals without reprogramming them.
For example: ReverseSignal=true.
Your indicator gives a signal to BUY, but the Expert will open a SELL deal.
Your indicator gives a signal on SELL, but the Expert Advisor will open a BUY deal.
3. Magic number
Magic (0.…99999) number.
This parameter represents a special number of the Expert Advisor on the chart. If you use a lot of Expert Advisors on different charts you will need to give them unique numbers to avoid confusing of deals.
For example, if you use one Expert Advisor with different settings, you should give a unique magic number to each instance of the Expert Advisor. Also this parameter should be changed on different currency pairs to deal with detailed reports, to understand what currency pair is used by each Expert Advisor.
4. Stop Loss of the deal
StopLoss (0…) in points.
This parameter represents the Stop Loss of each position. This is the number of loss points for a deal to be closed.
0 — the parameter is disabled, the Stop Loss of the deal will be equal to 0.
This parameter should be set to no less than the minimum allowed stop value on your server.
If the parameter is less than the minimum allowed value on the server, the Expert Advisor will show the error 130.
5. Take Profit of the deal
TakeProfit (0…) in points.
This parameter represents the Take Profit of each position. This is the number of profit points for a deal to be closed by the server.
0 — the parameter is disabled, the Take Profit of the deal will be equal to 0.
This parameter should be set to no less than the minimum allowed value on your server.
If the parameter is less than the minimum allowed on the server, the Expert Advisor will show the error 130.
6. Slippage of the deal
Slippage(0.…) in points.
This parameter adjusts price slippage at opening of a deal.
On the real market price moves very fast, so when sending the order to the server, the server can respond: prices changed, requotes, etc. In order not to send a lot of orders to the server, you can set the allowed slippage for opening deals.
For example: Slippage=10.
When sending an order for opening, the price was 1.1234. But price changed to 1.1238. In this case the deal is opened at price 1.1238 without requotes! But if Slippage were equal 0, in this example the deal would not be be opened, the server would send the Requote error (New prices).
7. Closing deals by an opposite signal
ClosePosifChange (true — false).
This parameter adjusts the possibility to close an opposite deal when opening the new one. If your indicator uses BUY — SELL — BUY — SELL signals and this parameter is enabled, the Expert Advisor will close the opposite deal before opening the new one.
This parameter is used to choose whether a single or multiple positions should be opened.
If this parameter is enabled, only one positions is opened at each signal on 1 bar.
For example, your strategy gives consequent BUY signals on each new bar, and the function ONlyOnePosbySignal= true, then a BUY deal will be opened on each bar if the signal appears.
If the function ONlyOnePosbySignal = false, then the Expert Advisor can open only one BUY deal and one SELL deal and wait until they are closed.
9. Fixed lot
Lots (0.01 .….….) — setting fixed lot for all deals.
This parameter specifies the number of lots for opening deals. The lot is fixed and applied to all deals.
You should ask the minimum allowed lot for opening a deal from your broker.
10. Dynamic lot
DynamicLot (true — false) LotBalancePcnt (in percentage from free margin).
These parameters adjust automatic calculation of lot and choosing lot depending on free margin.
The detailed description of this parameter is given in the Autolot article (lot calculation using the current balance).
Martin (1.…) — Martingale ratio.
This parameter allows you to use the Martingale principle for your strategy, which implies that the volume of a deal following an unprofitable deal will be calculated as Lot * Martin ratio.
If the parameter is equal to 1, then Martingale is not used.
For example: Lots = 0.01 Martin =2:
BUY deal (0.01) closed with loss or by Stop Loss
the next deal will be opened with lot 0.01 * 2 = 0.02.
if the previous deal is closed by Stop Loss, then the following deal will be opened with lot 0.04.
If the previous deal is closed with profit or by Take Profit, then the following deal will be opened with the initial lot 0.0.
12. Working time of the Expert Advisor
OpenHour (in hours), OpenMinute (in minutes), CloseHour (in hours), CloseMinute (in minutes).
These parameters adjust the Expert Advisor working time range, and this time applies to opening new positions only. Trailing stop and break even will work independently from the range.
For example, you want the Expert Advisor to trade only from 2 p.m. to 6.35 p.m. Then the parameters will look like:
IfProfTrail — if true, the Expert Advisor starts modification only when the positions is in the break even. If false, trailing stop starts working right after opening a position and pulls it after the price.
TrailingStop — distance in points from the current price to the estimated Stop Loss. This parameter can be less than the minimum allowed parameter on your server.
TrailingStep — Stop Loss modification step.
For example, Stop Loss will be modified each TrailingStep points on the distance of TrailingStop points from the current price.
14. Function for closing by total profit\loss
These parameters adjust the possibility to close deal(s) by the given instrument and magic reaching reaching one of the parameters:
prifitessss=10 — number of units (depending on TypeofClose) for closing profit;
CloseLoss=false — close if lossss= ‑10 — number of units (depending on TypeofClose) for closing loss;
OFFAllEaAfterClosePROF=false — disable all the Expert Advisors and scripts after closing profit;
OFFAllEaAfterCloseLOSS=false — disable all the Expert Advisors and scripts after closing loss.
If you would like to close several deals BUY\SELL at profit on the account in 10 $:
TypeofClose=1, CloseProfit=true, prifitessss=10.
If you would like to close several deals BUY\SELL at loss on the account in 200 points:
TypeofClose=2, CloseLoss=true, lossss=200.
If you would like to close several deals BUY\SELL at loss on the account in 5 % from the deposit and also close several deals BUY\SELL at profit on the account in 10 % from the deposit:
TypeofClose=4, CloseLoss=true, lossss=5, CloseProfit=true, prifitessss=10.
In this case you can disable Expert Advisors after closing using the OFFAllEaAfterClosePROF and\or OFFAllEaAfterCloseLOSS function. Then the Expert Advisor will disable all the Expert Advisors after closing.
15. Moving Stop Loss to break even
MovingInWLUSE (true — false) LevelWLoss (in points) LevelProfit (in points).
These parameters adjust the possibility to modify deals moving the Stop Loss to break even at the earliest opportunity.
You would like to set Stop Loss in the break even, when the deal will score +10 points of profit:
MovingInWLUSE = true, LevelWLoss=0, LevelProfit=10.
You want to set Stop Loss in +5 points, when the deal will score +20 points of profit:
MovingInWLUSE = true, LevelWLoss=5, LevelProfit=20.
Therefore the difference between LevelProfit-LevelWLoss must always be greater or equal to the minimum stop on the server.
This trend-following conservative Expert Advisor works on EURUSD, M5.
It open position according to signal of trading sytem in trend direction and closes position according to signal of trade system or …
Zigi Expert Advisor automatically opens BUY or SELL positions depending on the signals of three ZigZag indicators.
The trading volume used for opening positions depends on the deposit. It is possible …
Professional robot, which implemented trading strategy using neural networks. Used multi-layer fully connected feedforward networks MLP (multilayer perceptron).
The ability to learn is the main feature of the brain. Artificial neural …
Fast and high-quality trade copier for your real/demo account. This Expert Advisor is developed for copying trades from the ÐœetaTrader 5 terminal.
Multi-terminal Trade Copier:
The EA will copy all positions without …
RiskMonitorEA is a trading and analytical risk (potential loss size) controller. It consists of two blocks. The first one is an information-analytical part displaying data on the potential losses of …
Fast and high-quality trade copier for your real/demo account. This Expert Advisor is developed for the ÐœetaTrader 5 terminal to which trades will be copied.
Multi-terminal Trade Copier:
The EA will copy …
ExpertRegression is a professional trading robot, which implements the classic trading strategy inside a channel based on regression signal. The signal is formed at a breakthrough of the upper and …