This is a fully automated Expert Advisor implementing a statistical long-term trading system.
It uses several original indicators and several standard indicators to identify the change in the trend and opens a chain of orders. It always works using one or two orders, depending on OneTimeOneOrder (true/false). Currency pair: EURUSD. Working timeframe: Н1.
The EA does not use: martingale, grid, averaging and scalping.
Each deal is protected by a fixed stop loss and take profit, trailing stop is also used. The EA can use locking, i.e. it can open orders in different directions (if OneTimeOneOrder = false).
Statistics play the main part. The risk reward ratio of the opened orders is less than 1:2 (take profit is two times greater than stop loss), therefore, the key rule of money management is observed in the long term. Depending on the volatility, an average of 40 trades per month can occur. The position holding time is from several minutes to several days. The EA is resistant to spread and does not require fast execution of trade orders.
The EA is easy to use and suitable for both experienced and novice traders. Does not require optimization, as it is self-adaptive. It has a minimum of settings. The initial trading deposit depends on the traded lot.
The EA does not trade immediately after it is attached to a chart. It may take quite a lot of time for the EA to start trading after it is attached. During its operation, the EA saved the intermediate data to the oculus_data.csv file in the folder ...\MQL4\Files. The EA identifies the changes in the trend, but if a certain trend is dominant when the EA is being attached to a chart, the EA will wait for the trend to change. Instructions on how to manually set up immediate trading are available in the comments section, however doing this is not recommended. Although this does not disrupt the work of the Expert Advisor, it can slightly change the order chain.
The screenshots below show the forward tests in real market conditions. And also the results from the strategy tester.
Advisor automatically recognizes 4 and 5-digit quotes. Values for take profit, stop loss, and trailing stop are specified as for 4-digit quotes (in pips).
- Magic number - identifier of orders
- Take Profit, pips [50 - 150 pips, limits] - take profit in pips (50 to 150 pips for 4-digit quotes)
- Stop Loss, pips [20 - 80 pips, limits] - stop loss in pips (20 to 80 pips for 4-digit quotes)
- Lot - trading lot
- Dynamic Lot - use the lot as a percentage of free margin (false - use a fixed lot, true - use a dynamic lot)
- Mode_of_Dynamic_lot - dynamic lot calculation mode (lot_percent - lot as a percentage of equity, lot_add - addition of lot to the current one)
- Risk Percent, % (use it if lot = lot_percent) - risk per deal as a percentage of equity
- Each plus in the amount money to deposit (use it if lot = lot_add) - amount of the deposit increase
- Add lot to trade (use it if lot = lot_add) - value to be added to the initial lot
- Retry Attempt - the number of attempts to send an order or to modify a position in case of failure
- One Time One Order - (true/false) close or lock the deals
- Slippage - price slippage in pips
- Use Trailing Stop - (true/false) use trailing stop
- Trailing Step, pips - trailing step in pips (1 to 3 pips for 4-digit quotes)
- Trailing Distance, pips - trailing distance (1 to 3 pips for 4-digit quotes)
- Alerts - use sound alert when opening orders
- Notifications - send push notifications when opening or closing orders
- Show Info on Chart - (true/false) show information in the comment
- CurrentTrend - sets the initial trading direction (current trend), if not equal to n/a (for advanced users only)
Changed the code for closing trades to handle server errors.
Added the ability to set a dynamic lot depending on the equity increase step, adjusted with two parameters:
Each plus in the amount money to deposit - amount of the deposit increase.
Add lot to trade - value to be added to the initial lot.
For example: Lot = 0.1
Each plus in the amount money to deposit = 500
Add lot to trade = 0.1
Every time the deposit increases by 500 units, 0.1 lot is added to the initial lot. Then 0.2 lot is used in trading.
In the course of work, this lot size is changed according to the same principle.
Stop loss is restricted to 20-80 pips.
Take profit is restricted to 50-150 pips.
Minor corrections in the interface.
Slightly stabilized the strategy.
Fixed some bugs.
Improved the implementation of autoadjustment to 4 and 5-digit quotes
Improved trailing stop
Added the ability to disable trailing stop
Fixed the saving and restoring of the Expert Advisor operation after restarting the terminal
Made changes to the interface
Fixed minor bugs
Changed the initial requirements for the number of bars to start testing
Added the output of the operation type to notifications (Alerts, Notifications)
Added the ability to save information on the current positions and to continue operation after restarting the terminal or VPS
Improved the strategy
Fixed minor bugs