Olá alguém tem alguma ideia para que o EA reconheça automaticamente a noticia na parte input datetime NewsTime = __DATE__ ? Arquivo mq4 em anexo.

 
#property copyright "Participe de nossa redes sociais"
#property link      "t.me/grupoforexbrasil"
#property link      "www.facebook.com/groups/grupoforexbrasil"
#property version   "1.00"
#property strict

#property description "Opens a buy/sell trade (random, chosen direction, or both directions) seconds before news release."
#property description "Sets SL and TP. Keeps updating them until the very release."
#property description "Can set SL to breakeven when unrealized profit = SL."
#property description "Alternatively, adds ATR based trailing stop."
#property description "Closes trade after one hour."

enum dir_enum
{
   Buy,
   Sell,
   Both,
   Random
};

enum trailing_enum
{
        Breakeven,
        Full,
        None
};

// Trading parameters
input datetime NewsTime = __DATE__; // News date/time.
input int StopLoss = 15; // Stop-loss in broker's pips.
input int TakeProfit = 75; // Take-profit in broker's pips.
input dir_enum Direction = Both; // Direction of the trade to open.
input trailing_enum TrailingStop = None; // Type of trailing stop based on stop-loss.
input bool PreAdjustSLTP = false; // Preadjust SL/TP until news is out.
input int SecondsBefore = 18; // Open trade X seconds before the news.
input int CloseAfterSeconds = 3600; // Close trade X seconds after the news, 0 - turn the feature off.
input bool SpreadFuse = true; // SpreadFuse - prevent trading if spread >= stop-loss.
// ATR
input bool UseATR = false; // Use ATR-based stop-loss and take-profit levels.
input int ATR_Period = 14; // ATR Period.
input double ATR_Multiplier_SL = 1; // ATR multiplier for SL.
input double ATR_Multiplier_TP = 5; // ATR multiplier for TP.
// Money management
input double Lots = 0.01;
input bool MM  = true; // Money Management, if true - position sizing based on stop-loss.
input double Risk = 1; // Risk - Risk tolerance in percentage points.
input double FixedBalance = 0; // FixedBalance - If greater than 0, position size calculator will use it instead of actual account balance.
input double MoneyRisk = 0; // MoneyRisk - Risk tolerance in base currency.
input bool UseMoneyInsteadOfPercentage = false;
input bool UseEquityInsteadOfBalance = false;
input int LotDigits = 2; // LotDigits - How many digits after dot supported in lot size. For example, 2 for 0.01, 1 for 0.1, 3 for 0.001, etc.
// Timer
input bool ShowTimer = true; // Show timer before and after news.
input int FontSize = 18;
input string Font = "Arial";
input color FontColor = clrRed;
// Miscellaneous
input int Slippage = 3;
input int Magic = 794823491;
input string Commentary = "NewsTrader"; // Comment - trade description (e.g. "US CPI", "EU GDP", etc.).

// Global variables
bool HaveLongPosition, HaveShortPosition;
bool ECN_Mode;

int news_time;
bool CanTrade = false;
bool Terminal_Trade_Allowed = true;

double SL, TP;

// For tick value adjustment.
string ProfitCurrency = "", account_currency = "", BaseCurrency = "", ReferenceSymbol = NULL;
bool ReferenceSymbolMode;
int ProfitCalcMode;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                            |
//+------------------------------------------------------------------+
int init()



{
   news_time = (int)NewsTime;
   double min_lot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MIN);
   double lot_step = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_STEP);
   Print("Minimum lot: ", DoubleToString(min_lot, 2), ", lot step: ", DoubleToString(lot_step, 2), ".");
   if ((Lots < min_lot) && (!MM)) Alert("Lots should be not less than: ", DoubleToString(min_lot, 2), ".");
   else CanTrade = true;

        if (ShowTimer)
        {
           ObjectCreate("NewsTraderTimer", OBJ_LABEL, 0, 0, 0);
        ObjectSet("NewsTraderTimer", OBJPROP_CORNER, 0);
        ObjectSet("NewsTraderTimer", OBJPROP_XDISTANCE, 10);
        ObjectSet("NewsTraderTimer", OBJPROP_YDISTANCE, 130);
                EventSetMillisecondTimer(100); // For smooth updates.
        }

        // If UseATR = false, these values will be used. Otherwise, ATR values will be calculated later.
        SL = StopLoss;
        TP = TakeProfit;


        
   return(0);
}



//+------------------------------------------------------------------+
//| Stops timer and deletes graphical object if needed.              |
//+------------------------------------------------------------------+
int deinit()
{
   if (ShowTimer)
   {
        EventKillTimer();
        ObjectDelete("NewsTraderTimer");
        }
   return(0);
}

//+------------------------------------------------------------------+
//| Updates text about time left to news or passed after news.       |
//+------------------------------------------------------------------+
void OnTimer()





{
   DoTrading();
   string text;
   int difference = (int)TimeCurrent() - news_time;
   if (difference <= 0) text = "Time to news: " + TimeDistance(-difference);
   else text = "Time after news: " + TimeDistance(difference);
        ObjectSetText("NewsTraderTimer", text + ".", FontSize, Font, FontColor);
}

//+------------------------------------------------------------------+
//| Format time distance from the number of seconds to normal string |
//| of years, days, hours, minutes, and seconds.                                                        |
//| t - number of seconds                                                                                                                       |
//| Returns: formatted string.                                                                                                  |
//+------------------------------------------------------------------+
string TimeDistance(int t)
{
        if (t == 0) return("0 seconds");
        string s = "";
        int y = 0;
        int d = 0;
        int h = 0;
        int m = 0;
        
        y = t / 31536000;
        t -= y * 31536000;

        d = t / 86400;
        t -= d * 86400;

        h = t / 3600;
        t -= h * 3600;

        m = t / 60;
        t -= m * 60;
        
        if (y) s += IntegerToString(y) + " year";
        if (y > 1) s += "s";
        
        if (d) s += " " + IntegerToString(d) + " day";
        if (d > 1) s += "s";

        if (h) s += " " + IntegerToString(h) + " hour";
        if (h > 1) s += "s";
        
        if (m) s += " " + IntegerToString(m) + " minute";
        if (m > 1) s += "s";
        
        if (t) s += " " + IntegerToString(t) + " second";
        if (t > 1) s += "s";

        return(StringTrimLeft(s));
}

//+------------------------------------------------------------------+
//| Check every tick.                                                          |
//+------------------------------------------------------------------+
int start()





{
   return(DoTrading());
}
//+------------------------------------------------------------------+
//| Main execution procedure.                                                    |
//+------------------------------------------------------------------+
Arquivos anexados:
NewsTrader.mq4  25 kb
 
Eu consegui juntar um outro EA que desenha uma linha onde ocorrerá  noticia dentro dele. Mas quanto a função de input News Trade de forma automática não encontrei uma maneira de proceder. Arquivo mq4 está em anexo. Quem puder ajudar agradeço.
Arquivos anexados: