I am unable to get closing time for any position and ontrade not working

 

Hello,
I am scripting an EA to send post request using sockets in mql5. 

void OnTick()
  {
   Print("history-->", HistoryOrdersTotal());
   int socket = SocketCreate();

// Check the handle
   if(socket != INVALID_HANDLE)
     {
      // Connect if all is well
      if(SocketConnect(socket, Address, Port, 1000))
        {
         Print("Established connection to ", Address, ":", Port);

         string subject, issuer, serial, thumbprint;
         datetime expiration;

         if(SocketTlsCertificate(socket, subject, issuer, serial, thumbprint, expiration))
           {
            Print("TLS certificate:");
            Print("   Owner:  ", subject);
            Print("   Issuer:  ", issuer);
            Print("   Number:     ", serial);
            Print("   Print: ", thumbprint);
            Print("   Expiration: ", expiration);
            ExtTLS = true;
           }
        }
      else
        {
         Print("Connection to ", Address, ":", Port, " failed, error ", GetLastError());
        }

      // Close the socket after use
      SocketClose(socket);
     }
   else
     {
      Print("Failed to create a socket, error ", GetLastError());
     }
  }

Inside this post request I am sending the current trading data as this 

            ulong positionHandle = PositionGetTicket(i);

            ArrayResize(positionHandles, ArraySize(positionHandles) + 1);
            positionHandles[ArraySize(positionHandles) - 1] = positionHandle;
           }



         for(int j = 0; j < ArraySize(positionHandles); j++)
           {

            if(PositionSelectByTicket(positionHandles[j]))
              {


               ENUM_POSITION_TYPE positionType = PositionGetInteger(POSITION_TYPE);

               datetime tradeTime = PositionGetInteger(POSITION_TIME);
               string positionDirection;

               if(positionType == POSITION_TYPE_BUY)
                  positionDirection = "BUY";
               else
                  if(positionType == POSITION_TYPE_SELL)
                     positionDirection = "SELL";
                  else
                     positionDirection = "UNKNOWN";

               datetime closedTime;

               string symbol = PositionGetString(POSITION_SYMBOL);
               ulong ticket = PositionGetTicket(j);

               string tradeClosedStr = isTradeClosed ? "true" : "false";


               datetime currentTime = TimeCurrent();
               string formattedCurrentTime = TimeToString(currentTime, TIME_DATE | TIME_MINUTES); // Display only time


               string formattedTime = TimeToString(tradeTime, TIME_DATE | TIME_MINUTES);
               string formattedClosedTime = TimeToString(closedTime, TIME_DATE | TIME_MINUTES);


               double volume = PositionGetDouble(POSITION_VOLUME);
               double entryPrice = PositionGetDouble(POSITION_PRICE_OPEN);
               double takeProfit = PositionGetDouble(POSITION_TP);
               double stopLoss = PositionGetDouble(POSITION_SL);
               double currentPrice= PositionGetDouble(POSITION_PRICE_CURRENT);
               double currentProfit = PositionGetDouble(POSITION_PROFIT);
               ulong accountLogin; // To store the user's login


               accountLogin = AccountInfoInteger(ACCOUNT_LOGIN);
               string strAccountLogin = IntegerToString(accountLogin);
              // Print(ACCOUNT_LOGIN,"login---->",strAccountLogin);
               string totalTime = currentTime - tradeTime;
               //Print("trade time =",tradeTime," - ",currentTime, " = ","trading tiem-----:", totalTime);
               string tradesInfo = StringFormat("{\"login\":\"%I64d\",\"symbol\": \"%s\", \"volume\": %.5f, \"openPrice\": %.5f, \"takeProfit\": %.5f, \"stopLoss\": %.5f, \"currentPrice\": %.5f,\"type\": \"%s\", \"ticket\": %llu, \"tradeTime\": \"%s\", \"closingTime\": \"%s\",\"isTradeClosed\":\"%s\",\"currentProfit\": %.5f,\"currentTime\": \"%s\",\"duration\": \"%s\"}",
                                                accountLogin, symbol, volume, entryPrice, takeProfit, stopLoss, currentPrice, positionDirection, ticket, formattedTime, formattedClosedTime, tradeClosedStr, currentProfit, formattedCurrentTime, totalTime);

              

here I am unable to get the closing time the position just closed It will be really helpful if someone can give me any function or any logic to get closing time triggering event or any hit on closing of any position.

Also running the function on OnTick is making my server slow due to concurrent requests i want this logic to run on OnTrade or OnTradeTransaction but unable to run the scripts automatically getting removed when adding it to a chart .can anyone explain me how to make OnTrade working

 
1. Don't double post
2. Thank you for using the code button
3. Can you show me OnTrade
4. Closed positions are not in Positions but in History
 
Tobias Johannes Zimmer #:
1. Don't double post - 
2. Thank you for using the code button
3. Can you show me OnTrade
4. Closed positions are not in Positions but in History
thanks for replying ,
Where and how not to double post
I am running  the whole function on Ontrade but as it is not working that is why i have userd OnTick .
but I am unable to get history it shows history deals and orders as 0
void OnStart()
  {
   Print("history-->", HistoryDealsTotal()); 
  }
 

HistoryDealsTotal

Returns the number of deal in history. Prior to calling HistoryDealsTotal(), first it is necessary to receive the history of deals and orders using the HistorySelect() or HistorySelectByPosition() function.

You need to select the deals first.

 
akbar giro #:

You need to select the deals first.

Hi ,
thanks for resolving I got the information of history deals and orders and here is the data I got for one trade -
{
        "o_ticket": -265476697,
        "o_time_setup": "2024.02.19 14:17:51",
        "o_type": "ORDER_TYPE_SELL",
        "o_state": "ORDER_STATE_FILLED",
        "o_time_expiration": "1970.01.01 00:00:00",
        "o_time_done": "2024.02.19 14:17:51",
        "o_time_setup_msc": -1044711995,
        "o_time_done_msc": -1044711995,
        "o_type_filling": "ORDER_FILLING_FOK",
        "o_type_time": "1970.01.01 00:00:00",
        "o_magic": 0,
        "o_reason": "ORDER_REASON_CLIENT",
        "o_position_id": -265479043,
        "o_position_by_id": 0,
        "o_volume_initial": 0.03000,
        "o_volume_current": 0.00000,
        "o_open_price": 0.61378,
        "o_sl": 0.00000,
        "o_tp": 0.00000,
        "o_price_current": 0.61378,
        "o_price_stoplimit": 0.00000,
        "o_symbol": "NZDUSD",
        "o_comment": "",
        "o_extarnal_id": "",
        "digits": 5,
        "deal_ticket": -264702106,
        "deal_order": -265476697,
        "deal_time": "2024.02.19 14:17:51",
        "deal_time_msc": -1044711995,
        "deal_type": "DEAL_TYPE_SELL",
        "deal_entry": "DEAL_ENTRY_OUT",
        "deal_magic": 0,
        "deal_reason": "DEAL_REASON_CLIENT",
        "deal_position_id": -265479043,
        "deal_volume": 0.03,
        "deal_price": 0.61378,
        "deal_commission": 0.00000,
        "deal_swap": 0.00000,
        "deal_profit": -0.15000,
        "deal_symbol": "NZDUSD",
        "deal_comment": "",
        "deal_external_id": "",
        "deal_digits": 5
    }

Here I have a confusion Any one can please tell me what is the closing time of the particular trade because I have the entry time but not exit so still my issue to get closing time is not resolved.
 
Anshul Chouhan #:
Hi ,
thanks for resolving I got the information of history deals and orders and here is the data I got for one trade -

Here I have a confusion Any one can please tell me what is the closing time of the particular trade because I have the entry time but not exit so still my issue to get closing time is not resolved.
When you have a question about the result, you need to show both, the code that produces the result, as well as the result.

The result alone won't be enough to help. After all, you need help with the code, so please share the current version as well...
 
Dominik Egert #:
When you have a question about the result, you need to show both, the code that produces the result, as well as the result.

The result alone won't be enough to help. After all, you need help with the code, so please share the current version as well...
okay , thanks for informing here is the code 
string RequestTradeHistory()
  {
//--- request trade history
   string content = "{";
   long o_time_done ;
   HistorySelect(from_date,to_date);
   uint total_deals=HistoryDealsTotal();
   ulong ticket_history_deal=0;
//--- for all deals\
   content +=  "\"Deals\":";
   for(uint i=0; i<total_deals; i++)
     {
      //--- try to get deals ticket_history_deal

      if((ticket_history_deal=HistoryDealGetTicket(i))>0)
        {
         long     deal_ticket       =HistoryDealGetInteger(ticket_history_deal,DEAL_TICKET);
         long     deal_order        =HistoryDealGetInteger(ticket_history_deal,DEAL_ORDER);
         long     deal_time         =HistoryDealGetInteger(ticket_history_deal,DEAL_TIME);
         long     deal_time_msc     =HistoryDealGetInteger(ticket_history_deal,DEAL_TIME_MSC);
         long     deal_type         =HistoryDealGetInteger(ticket_history_deal,DEAL_TYPE);
         long     deal_entry        =HistoryDealGetInteger(ticket_history_deal,DEAL_ENTRY);
         long     deal_magic        =HistoryDealGetInteger(ticket_history_deal,DEAL_MAGIC);
         long     deal_reason       =HistoryDealGetInteger(ticket_history_deal,DEAL_REASON);
         long     deal_position_id  =HistoryDealGetInteger(ticket_history_deal,DEAL_POSITION_ID);

         double   deal_volume       =HistoryDealGetDouble(ticket_history_deal,DEAL_VOLUME);
         double   deal_price        =HistoryDealGetDouble(ticket_history_deal,DEAL_PRICE);
         double   deal_commission   =HistoryDealGetDouble(ticket_history_deal,DEAL_COMMISSION);
         double   deal_swap         =HistoryDealGetDouble(ticket_history_deal,DEAL_SWAP);
         double   deal_profit       =HistoryDealGetDouble(ticket_history_deal,DEAL_PROFIT);

         string   deal_symbol       =HistoryDealGetString(ticket_history_deal,DEAL_SYMBOL);
         string   deal_comment      =HistoryDealGetString(ticket_history_deal,DEAL_COMMENT);
         string   deal_external_id  =HistoryDealGetString(ticket_history_deal,DEAL_EXTERNAL_ID);

         string time=TimeToString((datetime)deal_time,TIME_DATE|TIME_MINUTES|TIME_SECONDS);
         string type=EnumToString((ENUM_DEAL_TYPE)deal_type);
         string entry=EnumToString((ENUM_DEAL_ENTRY)deal_entry);
         string str_deal_reason=EnumToString((ENUM_DEAL_REASON)deal_reason);
         long digits=5;
         if(deal_symbol!="" && deal_symbol!=NULL)
           {
            if(SymbolSelect(deal_symbol,true))
               digits=SymbolInfoInteger(deal_symbol,SYMBOL_DIGITS);
           }
         //---
    
         if(HistoryOrderSelect(deal_order))
           {
            long     o_ticket          =HistoryOrderGetInteger(deal_order,ORDER_TICKET);
            long     o_time_setup      =HistoryOrderGetInteger(deal_order,ORDER_TIME_SETUP);
            long     o_type            =HistoryOrderGetInteger(deal_order,ORDER_TYPE);
            long     o_state           =HistoryOrderGetInteger(deal_order,ORDER_STATE);
            long     o_time_expiration =HistoryOrderGetInteger(deal_order,ORDER_TIME_EXPIRATION);
            o_time_done       =HistoryOrderGetInteger(deal_order,ORDER_TIME_DONE);
            long     o_time_setup_msc  =HistoryOrderGetInteger(deal_order,ORDER_TIME_SETUP_MSC);
            long     o_time_done_msc   =HistoryOrderGetInteger(deal_order,ORDER_TIME_DONE_MSC);
            long     o_type_filling    =HistoryOrderGetInteger(deal_order,ORDER_TYPE_FILLING);
            long     o_type_time       =HistoryOrderGetInteger(deal_order,ORDER_TYPE_TIME);
            long     o_magic           =HistoryOrderGetInteger(deal_order,ORDER_MAGIC);
            long     o_reason          =HistoryOrderGetInteger(deal_order,ORDER_REASON);
            long     o_position_id     =HistoryOrderGetInteger(deal_order,ORDER_POSITION_ID);
            long     o_position_by_id  =HistoryOrderGetInteger(deal_order,ORDER_POSITION_BY_ID);

            double   o_volume_initial  =HistoryOrderGetDouble(deal_order,ORDER_VOLUME_INITIAL);
            double   o_volume_current  =HistoryOrderGetDouble(deal_order,ORDER_VOLUME_CURRENT);
            double   o_open_price      =HistoryOrderGetDouble(deal_order,ORDER_PRICE_OPEN);
            double   o_sl              =HistoryOrderGetDouble(deal_order,ORDER_SL);
            double   o_tp              =HistoryOrderGetDouble(deal_order,ORDER_TP);
            double   o_price_current   =HistoryOrderGetDouble(deal_order,ORDER_PRICE_CURRENT);
            double   o_price_stoplimit =HistoryOrderGetDouble(deal_order,ORDER_PRICE_STOPLIMIT);

            string   o_symbol          =HistoryOrderGetString(deal_order,ORDER_SYMBOL);
            string   o_comment         =HistoryOrderGetString(deal_order,ORDER_COMMENT);
            string   o_extarnal_id     =HistoryOrderGetString(deal_order,ORDER_EXTERNAL_ID);

            string str_o_time_setup       =TimeToString((datetime)o_time_setup,TIME_DATE|TIME_MINUTES|TIME_SECONDS);
            string str_o_type             =EnumToString((ENUM_ORDER_TYPE)o_type);
            string str_o_state            =EnumToString((ENUM_ORDER_STATE)o_state);
            string str_o_time_expiration  =TimeToString((datetime)o_time_expiration,TIME_DATE|TIME_MINUTES|TIME_SECONDS);
            string str_o_time_done        =TimeToString((datetime)o_time_done,TIME_DATE|TIME_MINUTES|TIME_SECONDS);
            string str_o_type_filling     =EnumToString((ENUM_ORDER_TYPE_FILLING)o_type_filling);
            string str_o_type_time        =TimeToString((datetime)o_type_time,TIME_DATE|TIME_MINUTES|TIME_SECONDS);
            string str_o_reason           =EnumToString((ENUM_ORDER_REASON)o_reason);


            content += StringFormat("{ \"o_ticket\": %d, \"o_time_setup\": \"%s\", \"o_type\": \"%s\", \"o_state\": \"%s\", "
                                    "\"o_time_expiration\": \"%s\", \"o_time_done\": \"%s\", \"o_time_setup_msc\": %d, "
                                    "\"o_time_done_msc\": %d, \"o_type_filling\": \"%s\", \"o_type_time\": \"%s\", \"o_magic\": %d, "
                                    "\"o_reason\": \"%s\", \"o_position_id\": %d, \"o_position_by_id\": %d, \"o_volume_initial\": %.5f, "
                                    "\"o_volume_current\": %.5f, \"o_open_price\": %.5f, \"o_sl\": %.5f, \"o_tp\": %.5f, "
                                    "\"o_price_current\": %.5f, \"o_price_stoplimit\": %.5f, \"o_symbol\": \"%s\", \"o_comment\": \"%s\", "
                                    "\"o_extarnal_id\": \"%s\", \"digits\": %d, \"deal_ticket\": %d, \"deal_order\": %d, \"deal_time\": \"%s\", "
                                    "\"deal_time_msc\": %d, \"deal_type\": \"%s\", \"deal_entry\": \"%s\", \"deal_magic\": %d, \"deal_reason\": \"%s\", "
                                    "\"deal_position_id\": %d, \"deal_volume\": %.2f, \"deal_price\": %.5f, \"deal_commission\": %.5f, "
                                    "\"deal_swap\": %.5f, \"deal_profit\": %.5f, \"deal_symbol\": \"%s\", \"deal_comment\": \"%s\", "
                                    "\"deal_external_id\": \"%s\", \"deal_digits\": %d }",
                                    o_ticket, str_o_time_setup, str_o_type, str_o_state, str_o_time_expiration, str_o_time_done,
                                    o_time_setup_msc, o_time_done_msc, str_o_type_filling, str_o_type_time, o_magic,
                                    str_o_reason, o_position_id, o_position_by_id, o_volume_initial, o_volume_current,
                                    o_open_price, o_sl, o_tp, o_price_current, o_price_stoplimit, o_symbol, o_comment, o_extarnal_id, digits,
                                    deal_ticket, deal_order, time, deal_time_msc, type, entry, deal_magic, str_deal_reason,
                                    deal_position_id, deal_volume, deal_price, deal_commission, deal_swap, deal_profit,
                                    deal_symbol, deal_comment, deal_external_id, digits);

           }
         else
           {
            content+="";
           }

        }
      content +=",";
     }
//---
   content +="}";
   if(InpOutput==txt_file)
      FileClose(file_handle);
   return content;
  }
and on running this function I get in response all the trades I have made and for a single trade I get this data 
{
        "o_ticket": -265476697,
        "o_time_setup": "2024.02.19 14:17:51",
        "o_type": "ORDER_TYPE_SELL",
        "o_state": "ORDER_STATE_FILLED",
        "o_time_expiration": "1970.01.01 00:00:00",
        "o_time_done": "2024.02.19 14:17:51",
        "o_time_setup_msc": -1044711995,
        "o_time_done_msc": -1044711995,
        "o_type_filling": "ORDER_FILLING_FOK",
        "o_type_time": "1970.01.01 00:00:00",
        "o_magic": 0,
        "o_reason": "ORDER_REASON_CLIENT",
        "o_position_id": -265479043,
        "o_position_by_id": 0,
        "o_volume_initial": 0.03000,
        "o_volume_current": 0.00000,
        "o_open_price": 0.61378,
        "o_sl": 0.00000,
        "o_tp": 0.00000,
        "o_price_current": 0.61378,
        "o_price_stoplimit": 0.00000,
        "o_symbol": "NZDUSD",
        "o_comment": "",
        "o_extarnal_id": "",
        "digits": 5,
        "deal_ticket": -264702106,
        "deal_order": -265476697,
        "deal_time": "2024.02.19 14:17:51",
        "deal_time_msc": -1044711995,
        "deal_type": "DEAL_TYPE_SELL",
        "deal_entry": "DEAL_ENTRY_OUT",
        "deal_magic": 0,
        "deal_reason": "DEAL_REASON_CLIENT",
        "deal_position_id": -265479043,
        "deal_volume": 0.03,
        "deal_price": 0.61378,
        "deal_commission": 0.00000,
        "deal_swap": 0.00000,
        "deal_profit": -0.15000,
        "deal_symbol": "NZDUSD",
        "deal_comment": "",
        "deal_external_id": "",
        "deal_digits": 5
    }

please tell me how to know the trading time for this trade and if not present here how to calculate the closing time please resolve

 
Anshul Chouhan #:
okay , thanks for informing here is the code 
and on running this function I get in response all the trades I have made and for a single trade I get this data 

please tell me how to know the trading time for this trade and if not present here how to calculate the closing time please resolve


DEAL_ORDER is incompatible to HistoryOrderSelect.

You need to use POSITION_ID as identification.

 
Dominik Egert #:

DEAL_ORDER is incompatible to HistoryOrderSelect.

You need to use POSITION_ID as identification.

How to get closing time or what is the function or code to get the closing time of history trades 
this is my main concern 

 
Anshul Chouhan #:

How to get closing time or what is the function or code to get the closing time of history trades 
this is my main concern 

So, a position has at minimum two deals, one to open, and one to close. But you can have more deals than that.

Let's say you want to find the last deal that closes out the position, then you need to search for the joungest deal related to that position.

So, either you have the position_id from the position at the time it was still open, or you need to identify that deal. Latter is a bit more complex.

In first case it is simple, you store the open time and the position_id, then you select the history between open time and now. Now you select the deal by using position_id. You repeat that until you have reached the end. The last successful call has your closing time.

In the latter case, I suggest to use OnTradeTransaction, or OnTrade to get notified of changes to your positions. It will take some effort to catch what you are looking for, but it is in there.

Hope this helps.
 
Dominik Egert #:
So, a position has at minimum two deals, one to open, and one to close. But you can have more deals than that.

Let's say you want to find the last deal that closes out the position, then you need to search for the joungest deal related to that position.

So, either you have the position_id from the position at the time it was still open, or you need to identify that deal. Latter is a bit more complex.

In first case it is simple, you store the open time and the position_id, then you select the history between open time and now. Now you select the deal by using position_id. You repeat that until you have reached the end. The last successful call has your closing time.

In the latter case, I suggest to use OnTradeTransaction, or OnTrade to get notified of changes to your positions. It will take some effort to catch what you are looking for, but it is in there.

Hope this helps.

Thankyou so much for the help ,
what you mean to say is that there is no any function or any method inbuilt in mql5 to get closing time for history deals .
I am using onTrade and OntradeTransaction function onwards but then too I am unable to get the closing time of a single deal also if i am getting by any means of calculation it is ' 1708507218 ' in this format which concludes to 1970.01.01 00:00 on converting to date 

this is the code i am using 
void GetAllHistoryDealInfo()
  {
// Loop through all history deals
   Print("this is history deal info");
   datetime from_date = D'2023.02.21 23:25:58';
   datetime to_date = TimeCurrent();
//Print("time :",TimeCurrent());
   HistorySelect(from_date,to_date);
   Print("orders :",HistoryOrdersTotal());
   Print("deals :",HistoryDealsTotal());
   for(int i = 36; i < HistoryDealsTotal(); i++)
     {
      ulong deal_ticket = HistoryDealGetTicket(i);
      ulong close_ticket = HistoryDealGetInteger(deal_ticket, DEAL_MAGIC);
      datetime close_time = 0;
      double close_price = 0.0;
      for(int j = 0; j < HistoryDealsTotal(); j++)
        {
         ulong ticket = HistoryDealGetTicket(j);
         if(ticket == close_ticket)
           {
            close_time = HistoryDealGetInteger(ticket, DEAL_TIME);
            close_price = HistoryDealGetDouble(ticket, DEAL_PRICE);
            break;
           }
        }
      // Retrieve deal information
      double open_price = HistoryDealGetDouble(deal_ticket, DEAL_PRICE);
      datetime open_time = HistoryDealGetInteger(deal_ticket, DEAL_TIME);
      double net_profit_loss = HistoryDealGetDouble(deal_ticket, DEAL_PROFIT);
      double volume = HistoryDealGetDouble(deal_ticket, DEAL_VOLUME);
      double stop_loss = HistoryDealGetDouble(deal_ticket, DEAL_SL);
      double take_profit = HistoryDealGetDouble(deal_ticket, DEAL_TP);
      // int duration = HistoryDealGetInteger(deal_ticket, DEAL_DURATION);
      int duration_seconds = (int)(close_time - open_time);
      ENUM_DEAL_TYPE deal_type = HistoryDealGetInteger(deal_ticket, DEAL_TYPE);

      // Print or process the retrieved data
      Print("Symbol: ", Symbol());
      Print("Deal Ticket: ", deal_ticket);
      Print("Open Price: ", open_price);
      Print("Open Time: ", TimeToString(open_time));
      Print("Close Price: ", close_price);
      Print("Close Time: ", TimeToString(close_time));
      Print("Net Profit/Loss: ", net_profit_loss);
      Print("Volume: ", volume);
      Print("Stop Loss: ", stop_loss);
      Print("Take Profit: ", take_profit);
      Print("Duration: ", duration_seconds);
      Print("Deal Type: ", EnumToString(deal_type));
     }

  }

//getting this in response 
2024.02.22 10:29:50.354	historytrades (USDSEK,M15)	this is history deal info
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	orders :36
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	deals :37
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Symbol: USDSEK
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Deal Ticket: 150062303060
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Open Price: 0.65663
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Open Time: 2024.02.21 09:20
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Close Price: 0.0
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Close Time: 1970.01.01 00:00
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Net Profit/Loss: 0.0
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Volume: 0.03
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Stop Loss: 0.0
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Take Profit: 0.0
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Duration: -1708507218
2024.02.22 10:29:50.360	historytrades (USDSEK,M15)	Deal Type: DEAL_TYPE_BUY


//which is most probably 
Reason: