I'm trying to return the current profit on an open order based on the order comment. Right now, my code below but is getting the profit of all open orders as opposed to just the order with a specific comment.
So, what I want to return is the profit for the order that the order comment is "Testing".
double Profit=0;
for(int i=0; i<OrdersTotal(); i++ )
{
if(OrderSelect(i, SELECT_BY_POS)==true)
{
if (OrderComment()=="Testing")
Profit+= (OrderProfit()+OrderSwap()+OrderCommission());
}