NEWS TRADE

9 April 2022, 12:49
Konstantin Kulikov
0
1 705

Full description of News Trade EA MT4 and News Trade EA MT5 (experts for different platforms are completely identical in their work).

The program contains flexible settings for trading on the news of the economic calendar. It cannot be checked in the strategy tester. Only real work. In the terminal settings, you need to add the news site to the list of allowed URLs. Click Tools > Options > Expert Advisors. Check the option "Allow WebRequests for listed URL:". Add this: https://ec.forexprostools.com/

Monitoring default settings in fully automatic mode: https://www.mql5.com/en/signals/1447007 . Attach the EA to the GBPUSD chart of any timeframe (the timeframe doesn't matter) to get the same result.

When creating your own sets of settings for this EA, refer to the description of all parameters below. (Website for news viewing: https://www.investing.com/economic-calendar/ ).

New designed sets can be downloaded here: https://www.mql5.com/en/blogs/post/747929


Description of all parameters

  • ==== Used Symbols ==== // The parameters from this block allow you to work from one chart on several currency pairs. Or you can work only with the currency pair of the chart to which the Expert Advisor is attached. //
  • Use_Symbols_from_Line - if true, trading on all symbols from the Symbols_Line line; if false, trading on the chart symbol;       
  • Symbols_Line - if Use_Symbols_from_Line=true, then trading on symbols from this line (write symbols without prefixes and suffixes);
  • Symbol_prefix - if terminal symbols have a prefix, then write it in this line;
  • Symbol_suffix - if terminal symbols have a suffix, then write it in this line;
  • ==== Lot and MM ====  // Several trading lot calculation schemes and additional parameters. Select one scheme (by setting "true") and set the lot size in the next parameter, disable other schemes (by setting "false"). Read more here:  https://www.mql5.com/en/blogs/post/748029 . //
  • Use_Fix_Lots - enable/disable the fixed trading lot;
  • Value_Fixed_Lot - the value of the fixed lot;
  • Use_MM_1 - enable/disable the lot value based on balance;
  • Funds_for_001_Lot - amount of funds for 0.01 lot;
  • Use_MM_2 - enable/disable the lot value as a percent of deposit based on StopLoss;
  • Risk_Percentage - percent of deposit for lot value calculation;
  • Use_MM_Reg_1 - enable/disable recovery money management 1 (trading lot will not decrease in case of drawdowns);
  • Funds_for_001_Lot_Reg - amount of funds for 0.01 lot;
  • Use_MM_Reg_2 - enable/disable recovery money management 2 (trading lot will not decrease in case of drawdowns);
  • Risk_Percentage_Reg - percent of deposit for lot value calculation;
  • Lot_calculation_based_on - lot calculation based on balance or equity.
  • Lot_calculation_with_rounding - use rounding when calculating a trading lot (more aggressive lot calculation, to accelerate the increase in balance).

  • ==== GMT and DST ====  //  Synchronization of the time of the news site with the time of the terminal occurs automatically. Time Synchronization Check: https://www.mql5.com/en/blogs/post/748027 . //
  • GMT_Offset_AUTO - enable/disable automatic detection GMT Offset;
  • GMT_Offset_Manual - the value of the difference between your broker's server time and GMT;

  • ==== News Filter ==== // Pending orders are opened during the news period. These parameters allow you to select news and time intervals for placing orders. //
  • News_All_countries - take into account the news of all countries;
  • News_USA - take into account the news of the USA;
  • News_Europe - take into account the news of the Eurozone and the UK;
  • News_currency_pairs - take into account the news for the current charts currency pair;
  • News_currency_string - take into account the news for the currencies which are registered in a line News_currency_str;
  • Excluded_currency_str - do not take into account the news of the currency entered in this line, even if it was taken into account in the parameters above;
  • IncludeHigh - open pending orders before news of high importance;
  • SecondBeforeHigh - the number of seconds before the release of news of high importance, when pending orders are placed;
  • SecondAfterHigh - the number of seconds after the release of news of high importance, when pending orders are deleted;
  • IncludeMedium open pending orders before news of medium importance;
  • SecondBeforeMedium - the number of seconds before the release of news of medium importance, when pending orders are placed;
  • SecondAfterMedium -  the number of seconds after the release of news of medium importance, when pending orders are deleted;
  • IncludeLow - open pending orders before news of low importance;
  • SecondBeforeLow - the number of seconds before the release of news of low importance, when pending orders are placed;
  • SecondAfterLow -  the number of seconds after the release of news of low importance, when pending orders are deleted;
  • IncludeSpeaks - if "true", then open pending orders before news-speech of the considered importance; if "false", then avoid news-speech of the considered importance (ie, do not open any orders in the time ranges specified below).
  • SpeaksHigh - take into account news-speeches of high importance;
  • SpeaksMedium - take into account news-speeches of medium importance;
  • SpeaksLow - take into account news-speeches of low importance;
  • SecondBeforeSpeaks - the number of seconds before the release of the news-speech of the considered importance, when pending orders are placed (in the case of IncludeSpeaks=false, this is the beginning of the ban on opening any orders);
  • SecondAfterSpeaks - the number of seconds after the release of the news-speech of the considered importance, when pending orders are deleted (in the case of IncludeSpeaks=false, this is the end of the ban on opening orders);
  • Add_Event - add the date of the event manually (the strategy tester reacts on the specified date);
  • At_this_time_every_day - if true, then open orders every day at the time specified in "Add_Event" (hours:minutes:seconds);
  • SecondBeforeEvent - the number of seconds before the start of the event when pending orders are placed;
  • SecondAfterEvent - the number of seconds after the start of the event when pending orders are deleted;
  • InterestRateDecision - enable special conditions for Interest Rate Decision.
  • IncludeRate - if true, then open pending orders before the Interest Rate Decision; if false, then avoid the Interest Rate Decision (i.e., do not open any orders in the time ranges specified below).
  • SecondAfterRate - the number of seconds after the release of the Interest Rate Decision.
  • SecondBeforeRate - the number of seconds before the release of the Interest Rate Decision.
  • RateRemains - take into account the news of the Interest Rate if, according to the forecast, the interest rate remains the same.
  • RateChanges - take into account the news of the Interest Rate if, according to the forecast, the interest rate changes.
  • DirectionalOpening - open orders in the direction of the forecast of changes in the Interest Rate.
  • ==== Common parameters (standard points) ==== // In all parameters where the values are specified in points, you need to write standard points (by the 4th digit). //
  • Magic_number - a unique magic number for the EA's trades;
  • Comment_orders - a comment to the EA's trades ;
  • Trade_Direction - direction of orders (BUY, SELL);
  • Type_Orders - order types (STOP or LIMIT);
  • Offset_from_price - indent in points from the price for placing orders; 
  • Max_Spread_at_placing_orders - the maximum allowable spread at the time of placing orders (0 - disabled);
  • TakeProfit_Hide - virtual Take Profit hidden from a broker in points;
  • StopLoss_Hide - virtual Stop Loss hidden from a broker in points;
  • TakeProfit_Safety - Safety (real) Take Profit in points (TakeProfit_Safety has to be more TakeProfit_Hide);
  • StopLoss_Safety - Safety (real) Stop Loss in points (StopLoss_Safety has to be more StopLoss_Hide).
  • ==== Duration of the open position ==== 
  • Number_Minutes_and_Closing_Max_Bar - number of minutes after which the position will be closed if the price is maximum from the moment the position is opened (0 - disabled);
  • Number_Minutes_and_Closing_Medium_Bar - number of minutes after which the position will be closed if the price is not lower than the average value from the moment the position is opened (0 - disabled); 
  • Number_Minutes_and_Closing_Profit - number of minutes after which the position will be closed if it is in profit (0 - disabled); 
  • Max_Minutes_Open_Position - number of minutes after which the position will be closed (0 - disabled);
  • Minimum_Pips_at_Profit - minimum number of profit points for closing a positive position.
  • ==== Trailing Stop ==== 
  • Trailing_Reall - if true, then a real trailing stop is used, if false, then a hidden trailing stop;
  • Breakeven_Start - necessary amount of points from an position Open price for setting a breakeven. 0 - disabled.
  • Breakeven_Plus - increase a breakeven by a number of points.
  • Trailing_Stop - trailing stop value (0 - disabled);
  • Trailing_Step - trailing stop step;
  • Trailing_Start - necessary amount of points from an position open price for setting a trailing stop;
  • Duration_minutes_after_open - necessary amount of minutes after an position open price for setting a trailing stop.
  • ==== Grid and Martingale ==== 
  • Total_open_transactions - the maximum number of simultaneously open positions, if more than 1, then the grid mode is activated.
  • TP_for_Grid - Take Profit for grid mode;
  • Min_minuts_pause_between_positions - minimum pause in minutes between opening of positions;
  • Multiplier_of_Min_minuts_pause - multiplier for Min_minuts_pause_between_positions when opening the next position;
  • Min_pips_between_positions - minimum difference of the prices of opening in points, necessary for opening of the new position;
  • Multiplier_of_Min_pips_between_positions - multiplier for Min_pips_between_positions when opening the next position;
  • Close_positions_at_percentage_of_loss - percentage of floating loss from the balance at which all positions are closing (for each currency pair separately);  0 - disabled; (positions of other experts are not taken into account);
  • Multiplier_of_trade_Lot - multiplier for a trading lot when opening a new position in the positions grid;
  • Maximum_Lot_Size - maximum trading lot size;
  • ==== consider other positions ==== // Parameters from this block are intended for joint work with other Expert Advisors (taking into account open positions with other magic numbers). If you use this Expert Advisor separately, then these parameters do not affect. //
  • Total_deals_of_line_magics_for_one_symbol - the maximum number of simultaneously open positions with magic numbers from "Line_Magics" by the chart symbol; valid for values greater than 0; this parameter limits the opening of the first position and does not limit the opening of averaging positions.
  • Total_deals_of_line_magics_for_all_symbols - the maximum number of simultaneously open positions with magic numbers from "Line_Magics" for all symbols; valid for values greater than 0; this parameter limits the opening of the first position and does not limit the opening of averaging positions.
  • Total_deals_for_one_symbol_so_as_not_to_open_new_symbol - the maximum number of simultaneously open positions with magic numbers from "Line_Magics" for any one symbol, at which the first positions will not be opened for other symbols; valid for values greater than 1.
  • Line_Magics - line of magic numbers of positions; if empty, then the number of open positions is calculated for all (any) magic numbers.

Parsing Default Settings

The work is on pairs with GBP (GBPUSD, EURGBP, GBPJPY, GBPCAD, GBPAUD, GBPCHF) from one chart. GBP is the most volatile currency, which gives more chances for a successful exit from the deal.

  • Use_Symbols_from_Line = true;        
  • Symbols_Line = GBPUSD, EURGBP, GBPJPY, GBPCAD, GBPAUD, GBPCHF.

Pending orders are opened before the news of the currencies of the currency pair, in addition to the GBP (so that several orders are not opened at the same time). Thus, GBPUSD orders open before USD news, EURGBP orders before EUR news, GBPJPY orders before JPY news, etc. High importance news are taken into account.

  • News_currency_pairs = true;
  • Excluded_currency_str = GBP;
  • IncludeHigh = true.

To get more deals (more aggressive option) make the "Excluded_currency_str" line empty, then orders will be opened on GBP news as well. You can also add medium importance news IncludeMedium = true.

Pending orders are opened 60 seconds before the news is published. In 20 seconds after the publication of the news, unworked pending orders are deleted.

  • SecondBeforeHigh = 60;
  • SecondAfterHigh = 20.

If speeches of high and medium importance are scheduled in the coming hours, orders will not be opened.

  • IncludeSpeaks = false; 
  • SpeaksHigh = true;
  • SpeaksMedium = true.

To get more trades (more aggressive option) set SpeaksHigh = false and SpeaksMedium = false, then the speeches will not block the opening of orders.

A fake price movement is expected before the news is published, so LIMIT orders are used at a distance of 2.5 points from the price. Pending orders are opened in both directions (BUY and SELL). When one of the orders is triggered, the other one is deleted; if during the specified time none of the orders worked, then both are deleted.

  • Trade_Direction = BUY_and_SELL;
  • Type_Orders = ORDERS_LIMIT;
  • Offset_from_price = 2.5. 

Volatility during the news can be very different, so using the standard SL for all trades in a fully automatic mode seems to be ineffective. Since a short SL will often knock out and a large SL does not make sense, as it will take most of the balance. If you prefer sets with SL, then select careful settings for each currency pair separately (Use_Symbols_from_Line = false). In the default settings, a day is given to close positions at TP equal to 5 points. If the position is not closed in a day, then an averaging order is opened (maximum three positions for one currency pair).

  • TakeProfit_Safety = 5;
  • StopLoss_Safety = 0;
  • Total_open_transactions = 3;
  • Min_minuts_pause_between_positions = 1440;
  • Min_pips_between_positions = 35; 
  • Multiplier_of_trade_Lot = 1.5.

You can set the maximum drawdown as a percentage of the account balance for each currency pair, for example Close_positions_at_percentage_of_loss=30.

Parameters from the last block "consider other positions" are intended for joint work with other Expert Advisors (take into account open positions with other magic numbers). Therefore, you can add this expert to the general profile of experts.



Share it with friends: