多货币交易系统，基于标准指标。在此 EA 中应用了 12 个标准指标，可达 3 个信号。所有指标有可定制的外部参数。
这个版本有功能限制。高级功能仅在完整版中提供 - 通用 EA 完整版。
移动均线 (MA) (信号 1)
该信号计算两条均线的相对位置，一条周期较小 (快速 MA) ，另一条周期较大 (慢速 MA)。它们的参数可在以下变量中指定:
- MAFastPeriod 和 MASlowPeriod - 移动均线的周期。
- MAFastPrice 和 MASlowPrice - 移动均线的计算价格。
- MAFastShift 和 MASlowShift - 自右边偏移。
- MAFastMethod 和 MASlowMethod - 平均方法: 简单, 指数, 平滑, 线性加权。
当快速 MA 位于慢速 MA之上，买信号出现，当慢速 MA 位于快速 MA之上，卖信号出现。"无信号" 状态未使用。
移动均线收敛发散 (MACD) (信号 2)
- MACDFast - 快速 MA 周期
- MACDSlow - 慢速 MA 周期
- MACDSignal - 信号 MA 周期
- MAPrice - MAs 计算价格。
信号很简单: 买 - 主线高于信号线, 卖 - 主线低于信号线。"无信号" 未使用。
随机振荡器 (信号 3)
振荡器由两条线构成 - 主线和信号线，根据两线交叉进行交易。所以，信号如下: 买 - 主线高于信号线，卖 - 主线低于信号线。
- StochK - %K 周期。
- StochD - %D 周期。
- StochSlowing - 慢速指标。
- StochPrice - 计算价格。
- StochMethod - 平均方法。
RSI (信号 4)
指标类似于 CCI 和 DeMarker。离开超买 (RSIHighLevel) 和超卖 (RSILowLevel) 区间被用作一个适当的信号。所以，较少的卖信号对应于下穿高位，而买信号对应于上穿低位。主要状态 - "无信号"。指标周期可以设置在 RSIPeriod 参数，而计算价格 - 在 RSIPrice 参数。
商品通道指数 (CCI) (信号 5)
所有三个信号均被使用，但主状态依然是 "无信号"。较少的交易信号对应于下穿高位 (卖) 和上穿低位 (买)。高位和低位由 CCIHighLevel 和 CCILowLevel 外部参数的值决定。指标计算周期和价格由 CCIPeriod 和 CCIPrice 的值决定。
Williams 百分比范围 (WPR) (信号 6)
该指标类似于 RSI, CCI 和 DeMarker。所以，信号相似: 卖 - 下穿超买位 (WPRHighLevel)，和买 - 上穿超卖位 (WPRLowLevel)。所有其它情况表示 "无信号" 状态。仅有指标周期参数 (WPRPeriod) 可以在外改变。
布林带 (信号 7)
所有三种类型信号表达: 买 - 之前蜡烛收盘价在低位线之下, 卖 - 之前蜡烛收盘价在高位线之上, "无信号" - 蜡烛收盘价在两线之间。外部变量:
- BandsPeriod - 指标周期。
- BandsShift - 自右偏移。
- BandsDeviation - 背离。
- BandsPrice - 计算价格。
包络线 (信号 8)
- EnvPeriod - 指标周期。
- EnvPrice - 计算价格。
- EnvShift - 自右偏移。
- EnvMethod - 平均方法。
- EnvDeviation - 指标背离。
由于该指标代表了一个通道，信号类似于在通道工作时的那些：买 -蜡烛收盘价在低位线下方，卖 - 蜡烛收盘价在高位线上方，而"无信号" - 收盘价在两者之间。
鳄鱼 (信号 9)
- JawPeriod - 下颌周期，蓝线。
- JawShift - 下颌自右偏移。
- TeethPeriod - 牙齿周期。
- TeethShift - 牙齿自右偏移。
- LipsPeriod - 唇周期。
- LipsShift - 唇自右偏移。
同样，相同平均方法 (AlligatorMethod) 和计算价格 (AlligatorPrice) 用于所有的线。所有线都有正的自右偏移。它可以从当前柱线读取指标数值，因为它们已经固定且不会被改变。所以，在此情况下信号如下: 买 - 唇线高于牙齿线，而后者高于下颌线; 卖 - 唇线低于牙齿线，而后者低于下颌线。其它情况无信号。
移动均线振荡器 (OsMA) (信号 10)
- OsMAFast - 快速 MA 周期。
- OsMASlow - 慢速 MA 周期。
- OsMASignal - 信号 MA 周期。
- OsMAprice - 计算价格。
动量振荡器(AO) (信号 11)
该振荡器没有提供用户参数。与这个指标工作的原理之一就是寻找 "飞碟"。Bill Williams 的 "飞碟" 由正数区域的两根增长的柱线以及在它们之间有一根较低的柱线组成。所以, "反向飞碟" 由负数区域的两根降低的柱线以及在它们之间有一根较高的柱线组成。因此，需要最后三根完整的蜡烛 (在代码中是四根蜡烛) 来检测一个 "飞碟"。买信号 - "飞碟", 卖信号 - "反向飞碟", "无信号" - 所有其它情况。
- IndSigToTrade - 信号 1, 数值从 1 到 12, 0 - 禁用。
- IndSigToTrade2 - 信号 2, 数值从 1 到 12, 0 - 禁用。
- IndSigToTrade3 - 信号 3, 数值从 1 到 12, 0 - 禁用。
- Lot - 成交交易量;
- StopLoss - 止损距离, 省缺是 90。
- TakeProfit - 止盈距离, 省缺是 60。
- TrailingStopUse - 启用移动止损;
- IfProfTrail - 仅当盈利为正时启用移动止损 (盈亏平衡模式);
- TrailingStop - 移动止损距离, 最小值为 0;
- TrailingStep - 移动步长;
- PAIR1 - 货币对 1, USDCHF 为省缺。
- MACD 参数:
- 自适应通道 ADX 参数:
- RSI 参数:
- CCI 参数:
- WPR 参数:
- NRTR 参数:
- AMA 参数:
- Ichimoku Kinko Hyo 参数:
Added output of the signal information to the journal when a trade is opened.
Fixed the multi-currency operation mode of the EA.
Operation by time feature
Attention: Trading by time involves only filtering for opening new deals based on new signals.
All other functions: Trailing stop, Breakeven, Averaging, Scaling up along the trend and other works around the clock.
Attention: All parameters for trading by time can be optimized in the tester.
If TradeStartStopbyTime = false, the EA trades around the clock.
If TradeStartStopbyTime = true, the trading by time is activated:
The trading by time period starts on Monday.
The EA starts working on Monday at OpenHourMonday:OpenMinuteMonday if TradeStartbyTimeMonday=true
For example, OpenHourMonday=3 and OpenMinuteMonday=40, then the EA starts trading on Monday at 40:03 server time
(time of your broker, indicated in the Market Watch).
Next, the EA checks the trading time according to the parameters: OpenHour:OpenMinute - trading start and CloseHour:CloseMinute - trading end time for one day.
For example: OpenHour=5 and OpenMinute=0, as well as CloseHour=18 and CloseMinute=59, then the EA will trade every day from 5:00 to 18:59.
To set a trading period from the starting time, set the ClosePeriod_Minute parameter - period in minutes.
For example, OpenHour=6 and OpenMinute=6 and ClosePeriod_Minute=00, then the EA sets the trading time from 0:00 to 180:6(180+9 minutes = 9 hours).
You can also set multiple time intervals for trading in the SeveralTimeWork parameter. Entry format: HH:MM-HH:MM;
where: Hour to start trading:Minute to start trading - Hour to stop trading: Minute to stop trading.
For example, SeveralTimeWork=3:00-5:00;7:30-8:50;12:00-15:00;
then the EA will trade during 3 time intervals. from 3:00 to 5:00, from 7:30 to 8:50 and from 12:00 to 15:00. The EA will not open order during the remaining time.
You can also close all open deals and pending orders outside the trading time, CloseAllTradesByOutOfTime=true.
The EA will trade during the time specified above, and when the trading time ends, the EA will close all open positions and orders.
TradeStartStopbyTimeFriday - Trading time for Friday.
This EA allows the users to set the trading time for the EA on Friday.
Time parameters for Friday: OpenHourFriday:OpenMinuteFriday - CloseHourFriday:CloseMinuteFriday
For example, the EA should not open new deals on Friday after 18:00, set:
OpenHourFriday=0:OpenMinuteFriday=0 - CloseHourFriday=18:CloseMinuteFriday=0
In this case, the EA will not open new deals after 18:00
It is also possible to close all open deals and pending orders on Friday at the specified time - 18:00, CloseFriday=true.
The block for operation by time allows to set the trading days: TradeByDays
For example, TradeByDays=true Days=1,2,3 - in this case, the EA will trade only on Monday, Tuesday and Wednesday during the time specified above. Or it will trade around the clock those 3 days, if the time is not specified.
If you set Days=1,2,3,4,5 but with TradeStartStopbyTimeFriday=false, the EA will not trade on Friday.
It is also possible to set 1 day for optimization in the DayForOptimization parameter.
This option is useful to determine the most profitable days in optimization.
For example, DayForOptimization = 3, then the EA will trade only on Wednesdays.
You can set the trading to start on Monday and to stop on Friday, while the EA trades around the clock on the remaining days.
You can set the start on Monday and specific hours on other days.
-Fixed error with the DistanceMartin
Block of Parabolic SAR based trailing stop
-Added parameter TrailingStopSAR_TimeFrame - Timeframe of the SAR indicator for the trailing stop.
-To the МТ5 version: Added Parabolic SAR based trailing stop
TrailingStopSAR (true - false) step and maximum (parameters of the Parabolic SAR)
These parameters allow the modification of stop loss based on the specified Parabolic
The stop loss will be modified at every new value of the Parabolic SAR.
Accordingly, Buy is modified when the Parabolic SAR is below the price, Sell is modified when the Parabolic is above the price.
Block of signals
-Added parameter Signal_Reverse,Filter1_Reverse,Filter2_Reverse - they allow to inverse signals
based on specific indicators (Main signal, Filter 1 and Filter 2)
-Changed the MinuteToOpenNextPosition parameter (Allow opening the next signal after the last opened position),
if there are no open positions, the EA considers the time since the last closed position.
The time is considered for the same type. If the signal is BUY, the time is calculated from the last opened \ closed BUY....
-Changed the function for receiving signal when using signal inversion.
*If you use WPR as signal source, with the levels:
WPRLowLevel = -80;
Buy is opened, if WPR crosses WPRLowLevel (-80) upwards
SELL is opened, if WPR crosses WPRHighLevel (-20) downwards
*If you enable the option: Signal_Reverse=true
SELL is opened, if WPR crosses WPRLowLevel (-80) upwards
Buy is opened, if WPR crosses WPRHighLevel (-20) downwards
*If you enable the option: Signal_Reverse=true and set the parameters:
WPRLowLevel = -20;
Buy is opened, if WPR crosses WPRHighLevel (-80) downwards
SELL is opened, if WPR crosses WPRLowLevel (-20) upwards
- added parameters for the MACD signal
Which are involved in determining the signal.
for example: MACD_BUYLEVEL=3,MACD_SELLLEVEL=-3
For the long trade, the signal crosses the MACD line and at the end of that candle the MACD is greater than 0 and MACD is less than 3,0 (the signal line and MACD line must be both above the origin and less than 3.0).
For the short trade, the signal crosses the MACD line and at the end of that candle the MACD is less than 0 and MACD is greater than -3,0 (the signal line and MACD line must be both below the origin and greater than 3.0).
-Added automatic checking and normalization for all stops to tick size on the current currency pair.
For example, if the tick size on the WING17 symbol is 5 points, then all stop loss and take profit values will be normalized.
For example, the contract price is 58840 and the automatic stop loss calculation resulted in 1211 points, the final stop loss will be normalized to 1210 points.
Automated calculation of commission and swap has been added to the Trailing Stop and Breakeven functions.
Now trailing stop only triggers after a position covers the commission amount.
Limiting loss and profit per 1 day/week/month
Limiting LimitFor - Limitation type day/week/month
LimitForLosses - Limit by profit
LimitForProfits- Limit by loss
LimitType - Limit by USD, points, percentage of the deposit
ClosebyLIMITING - Close deals of the EA when the limit is exceeded
UseCurrentProfit - Consider the current profit/loss in calculation of limit
This function is capable of disabling the EA operation in case the EA accumulates certain profit/loss in deposit currency per day/week/month The EA will be reactivated the next day/week/month
For example, LimitFor=DAY LimitForProfits=1 Close by total profit = 10 USD
You can also select the limit type (LimitType) for calculations. In the USD, points, percentage of the account balance.
If you need to close and delete all deals using this EA once the limits are exceeded, you can set ClosebyLIMITING = true
The UseCurrentProfit parameter prohibits or allows considering the current floating profit/loss for this EA
Added new signals:
AC - signal principle is the same as in the АО indicator
Ichimoku - operation principle based on intersection of the TENKANSEN and KIJUNSEN lines,
If TENKANSEN is greater than KIJUNSEN - BUY signal
If TENKANSEN is less than KIJUNSEN - BUY signal
Bar - Work in the direction of the bar
If the candle Close is above the candle Open (Bullish candle) - BUY signal
If the candle Close is below the candle Open (Bearish candle) - SELL signal
Added new filters
AC - signal principle is the same as in the АО indicator
Ichimoku - operation principle based on location of the TENKANSEN and KIJUNSEN lines,
Bar - Work in the direction of the bar
Bar relatively MA - The EA signals are filtered based on the values of bar Close and Fast\Slow MA
If the bar Close is above MAfast and MAslow - only BUY signals
If the bar Close is below MAfast and MAslow - only SELL signals
Performed code optimization in order to reduce the CPU load.
Added support of the EA in the Brazilian market.
Added a new variable:
SeveralTimeWork = the EA operation time through listing,
start hour:start minute-end hour:end minute;start hour:start minute-end hour:end minute;
means that the EA will work from 9:00 to 10:00, also from 12:00 to 13:00, and also from 15:00 to 17:30
- Added the EAPADPRO information panel
Details on the panel in our blog:
The following data has been moved to the Strategy Info block:
OWN Signal = Name of the signal + Timeframe of the signal + Reverse
Current Signal = Current signal from the main indicator
Filter 1/2 - Name of the filter 1/2
Current Filter - Current signal from filters 1/2
BUY Average/Lot - Next averaging in points for BUY / Next averaging lot
SELL Average/Lot - Next averaging in points for SELL / Next averaging lot
Buy Additional/Lot - Next additional opening in points for BUY / Next lot for additional opening
Sell Additional/Lot - Next additional opening in points for SELL / Next lot for additional opening
Average Price Buy - Average price for BUY deals
Price Sell - Average price for SELL deals
Added support for working on the Brazilian market.
Added the new variable:
SeveralTimeWork = EA working time via enumeration,
start hour:start minute-end hour:end minute;start hour:start minute-end hour:end minute;
means that the EA works from 9:00 to 10:00, as well as from 12:00 to 13:00, as well as from 15:00 to 17:30
Added the Magic number
Fixed the error in balance calculation in the block of closing by profit for the accounts that use the day trading mode and equal to 0.
Added new functions to the 'Profit or Loss' block:
TrailOptions - The number of profit "units", after which profit trailing is activated;
TrailOptionsStep - Trailing step in "units";
Trailing Stop at Closing
A new function for trailing profits has been implemented on user demand. In this case, the profit is fixed with some correction. As soon as the profit reaches the specified value, the Expert Advisor saves the current profit level and starts trailing the profit. If you made settings for closing at the profit of 10 dollars:
CloseProfit - Close in profit.
prifitessss - The amount to close in profit.
TrailOptions - the distance from prifitessss, when reached the profit trailing is activated.
If prifitesss is set to 10 and TrailOptions is set to 5, the Trailing Stop will be set at 5 dollars. The Trailing Stop will come into play when the Expert Advisor passes the 10 dollar line and start moving following the profit. The Journal will show entries about the current profit status.
When the total profit falls below the last fixed level, TrailOptions, the Expert Advisor will perform forced closing of all positions.
Improved the OnePosPerDirection parameter: Open 1 trade per 1 direction
if OnePosPerDirection=true and ONlyOnePosbySignal = false
then the EA can open 1 Buy according to signal and 1 Sell according to signal
if OnePosPerDirection=false and ONlyOnePosbySignal = true
then the EA can open only 1 trade according to signal, either Buy or Sell
if OnePosPerDirection=false and ONlyOnePosbySignal = false
then the EA can open any trade according to any signal of the indicators
Added the OnlyOnePositionPerMagic parameter: Opening 1 position per 1 magic,
The EA checks if there are open positions with the specified magic number on other currency pairs. If there are no positions - the EA opens a trade according to the signal, and other experts will wait for this trade to be completed.
Added the CloseChangeOnlyInProfit parameter - close trades in case of a reverse signal only when the current position is in profit.
Added the MinuteToOpenNextPosition parameter - the number of minutes for opening the next trade based on the indicator signals. This parameter counts the number of minutes elapsed from the last opened position. It allows to filter trades when using the ONlyOnePosbySignal=false
Added the OpenOppositePositionAfterStoploss parameter - opening an opposite position when closing the current position by stop loss. It allows to open an opposite trade right after the stop loss of the previous is triggered without using the indicator signals.
Added the MAX_BUY_POSITION and MAX_SELL_POSITION parameters for limiting the maximum number of trades.
Added new input for selecting the type of the position to open:
The updated version for the stock market:
- Fixed the error in the determination of the last lot, if the position was closed by several requests.
Version 16.105 - 2016.01.06
Redesigned the signals block when the IndSigToTrade and IndSigToTrade2 are selected.
Before: A trade opens only when the two signals match at the same time.
Now: If the IndSigToTrade signal appeared, then the FILTER_IndSigToTrade2 and FILTER_IndSigToTrade3 indicators are checked. If their signals go on, the trade is opened.
I.e. If the IndSigToTrade is selected as the main signal, then the FILTER_IndSigToTrade2 and FILTER_IndSigToTrade3 parameters only trigger as filters.
Version 15.994 - 2015.12.23
Added automatic detection of the order filling type.
Version 15.992 - 2015.12.17
Added separation of deals by parameters:
MaxOrders = maximum number of smoothing deals (deals against the main position);
MaxOrdersOpenAdditionalOpen = maximum number of additional deals (deals along the main position);
Version 15.991 - 2015.12.11
Fixed take profit calculation when opening an additional trend following trade from the 'Additional opening' unit
For an additionally opened trade, take profit is equal to the TakeProfit parameter
Version 15.981 - 2015.11.25
In signals of Stochastic RSI CCI WPR, added levels for the EA to count signals from.
Version 15.956 - 2015.10.28
New block in sets:
AdditionalOpen - use opening additional orders by trend;
DistanceAdditionalOpen - distance of opened grid positions, adding by trend;
LotsMartinAdditionalOpen - increase lot for a position grid;
MaxOrdersOpenAdditionalOpen - maximum additions, 0 - unlimited.
If you want to open additional positions by trend (for example, if you buy and the price goes up through DistanceAdditionalOpen points, a new position should be opened equal to "previous lot * LotsMartinAdditionalOpen"). The maximum amount of deals in a single position should not exceed MaxOrdersOpenAdditionalOpen deals.
Version 15.943 - 2015.10.26
Version of October 23:
added option CloseAllTradesByOutOfTime
When using the trading permission block:
input int OpenHour = 0;
input int OpenMinute = 0;
input int CloseHour = 23;
input int CloseMinute = 59;
If CloseAllTradesByOutOfTime open positions remain after the time is up - all positions are closed.
Version 15.821 - 2015.08.27
Now you can select an indicator by its name as a matter of convenience
- NO=0 - No signal
- Ma=1 - Moving Average
- MACD=2 - Moving Average Convergence/Divergence (MACD)
- STOCH=3 - Stochastic Oscillator
- RSI=4 - RSI
- CCI=5 - Commodity Channel Index (CCI)
- WPR=6 - Williams Percent Range (WPR)
- BB=7 - Bollinger Bands
- Envelopes=8 - Envelopes
- Alligator=9 - Alligator
- OsMA=10 - Moving Average of Oscillator (OsMA)
- AO=11 - Awesome Oscillator (AO)
- ISH=12 - Ichimoku
Version 15.618 - 2015.06.19
Updates for brokers using IOC order filling type.
Fixed averaging error.
Version 15.601 - 2015.06.02
The Expert Advisor has been updated to adjust to the new terminal build.
Removed the limitation on the minimum averaging distance.
When using initial trailing stop and a set of signals for modifying the stop loss, the initial stop loss is reset and the TrailingStop function starts working instead.
The EA is best suited for working at VPS server.