Posts

Showing posts from December, 2024

MQL5: Closed order detail

 void lastclosedorder()   {    uint TotalNumberOfDeal = HistoryDealsTotal();    ulong Ticket = 0;    long OrderType, DealEntry, Reason;    string MySymbol = "";    double price = 0, stoploss = 0, target = 0;    double ltp = iClose(Symbol(), PERIOD_CURRENT, 0); // Last tick price or market price // Persistent static array to store processed tickets    static ulong ProcessedTickets[];    static int ProcessedTicketsCount = 0;    HistorySelect(0, TimeCurrent()); // Select the history for the current time range    for(uint i = 0; i < TotalNumberOfDeal; i++)      {       // Get the ticket ID       if((Ticket = HistoryDealGetTicket(i)) > 0)         {          // Check if this ticket has already been processed          if(IsTicketProcessed(Ticket, ProcessedTickets, Pr...

BuySEll scalp

 //+------------------------------------------------------------------+ //|                                                 BuySellScalp.mq5 | //|                                  Copyright 2024, MetaQuotes Ltd. | //|                                             https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2024, MetaQuotes Ltd." #property link      "https://www.mql5.com" #property version   "1.00" #define REASON_SL 2 #include <Trade\Trade.mqh> CTrade trade; input string TradeStartTime = "00:00"; input string TradeStopTime = "13:25"; input bool Monday = tr...