Opposite Orders
- 专家
- Serhii Fertikov
- 版本: 1.11
- 激活: 5
A news trading expert using deferred multi-directional stop orders.
Prior to the release of significant news, the advisor places pending BuyStop and SellStop orders, closing the opposite one in case either is triggered by the market.
The expert is integrated with an mql5 calendar for a year, allowing you to customize the advisor's parameters for any event from the calendar and test it on historical data.
Features:
Before starting the testing, attach the expert to the trading chart (The expert will calculate time zone offsets of your broker). After the calculation, you can remove the expert from the chart and proceed with testing/optimization.
For the expert to function, it is most convenient to use a 5-minute timeframe "m5".
The expert maintains a database of mql5 calendar events in SQLite. This database is continuously updated during operation.
The expert keeps a position database in SQLite. You can always review why a position was opened/closed.
The expert automatically calculates broker time zone offsets. (For these calculations, access to the API https://api.fxtdm.bid/ is required, and a chart of EURUSD must be present in the terminal.)
Settings:
The advisor has three strategies: "Strong", "Ordinary", "Weak" each with its parameters, and a section "----=== Events ===----" where a specific strategy can be assigned to an event.
If events with "Strong," "Ordinary," and "Weak" strategies occur simultaneously, the parameters of the strongest strategy, i.e., "Strong" in this case, are used.
1. ----=== Settings ===----
Basic expert settings- Magic Prefix (Magic_Prefics) - a numerical prefix to calculate the Magic Number (any number for order identification);
- Show Order Lines (Show_Order_Lines) - display order lines on the chart;
- Order Expiration (Order_Expiration_Sec) - the maximum time orders can exist; orders are canceled after this time;
- Time Left Event (Time_Left_Event_Sec) - time, in seconds, before the event's release when orders should be placed;
- Use Virtual TakeProfit StopLoss(Use_Virtual_Tp_Sl) - if True, the expert does not set stop loss/take profit but monitors them based on the real opening price of the position;
2. ----=== MoneyManagement ===----
Settings related to trade volume management. Here, you can configure volume increases based on the account balance.- Load previous settings? (Load_Previous_Settings) - the expert allows saving and restoring initial lot and balance settings. There are three modes: 1. "Don't Load" - do not use the settings file; 2. "Load" - load the settings file; 3. "Clear" - clear the settings file and use the parameters specified in the MoneyManagement section;
- Start Lots (Start_Lots) - starting lot or minimum lot;
- Coef Lot Balance(Coef_Lot_Balance) - the coefficient of lot increase with balance growth. If the value is 0.5, the lot size will increase by 0.5 when the balance doubles;
3. ----=== Martin ===----
This section allows for recovering losses. The expert checks if the total profit from recent trades is negative and increases the lot size by "Coef_Factor_Martin".- "Lot_Strategy" - enable/disable recovery logic;
- "Coef_Factor_Martin" - coefficient for increasing the recovery lot;
- "Coef_Factor_Martin_Max" - maximum coefficient for increasing the recovery lot;
- "Limit_Deals_Martin" - the number of recent deals used to calculate the total profit;
4. ----=== Strong strategy (Opposite stop orders) ===----
Sections for "Strong," "Ordinary," and "Weak" strategies.- Start Point Order"ss_start_point" - the number of points from the current median price at which to place the order;
- StopLoss Point"ss_tp_point" - take profit of the order;
- TakeProfit Point"ss_sl_point" - stop loss of the order;
- Hold Time sec"ss_hold_time" - the number of seconds to hold an open position;
5. ----=== Events ===----
The most important events of the economic calendar are listed here in the format: "id importance country[country code] event name"Limitations and Requirements
- 1. To use the expert, add the website https://api.fxtdm.bid/ to the allowed list;
- 2. The terminal must have a EURUSD chart;
- 3. The calendar only has events for the last year;
Contact:
If you have any questions or need assistance, please contact me via direct message.
Author:
Fertikov Serhii, More of my indicators, advisors, scripts are available in the seller's profile.