Can I know the order be stoploss in OnTrade Even under MT5?

ulong ld_ticket=0;

//---

if(HistorySelect(0,TimeCurrent()))

{

i=HistoryDealsTotal()-1;

//---

if(nmb_deal!=i) { Print("Number Last Deal: ",i); nmb_deal=i; } else { return; }

//---

if((ld_ticket=HistoryDealGetTicket((int)i))>0)

{

ld_comment=HistoryDealGetString(ld_ticket,DEAL_COMMENT);

//---

if(StringFind(ld_comment,"sl",0)!=-1) { Print("Close by Stop Loss: ",ld_comment); }

if(StringFind(ld_comment,"tp",0)!=-1) { Print("Close by Take Profit: ",ld_comment); }

}

}