how to fetch order's comment value
can anyone please let me know how to fetch the comment value for every order? Order's lot, open price, stoploss etc. can be easily taken via API, but how to fetch order's comment value? many thanks!
if you are using MT4 , look up ' OrderComment ' in the MQL4 Reference in the MetaQuotes Language Editor ?
“Everybody should have a dream. What if that dream comes true?” – Jack Ma
Something like:
for(i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if(OrderMagicNumber()==magic) //'magic' is the magic number you have set in code
{
Print(OrderProfit());
Print(OrderStopLoss());
Print(OrderComment());
}
}
for(i=OrdersTotal()-1; i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if(OrderMagicNumber()==magic) //'magic' is the magic number you have set in code
{
Print(OrderProfit());
Print(OrderStopLoss());
Print(OrderComment());
}
}
Please login to comment.