Getting OpenPrice from existing order

In an EA attached to a chart, I am trying to get the OpenPrice of a single order.
When the EA is on one chart with an open position, I get the correct value of the openprice, but when I attach it to a second chart (different pair), I get the correct pair name but the first chart’s openprice. This occurs even if the EX as no longer attached to first chart. Seems like the loop ain’t looping. Here’s my code snippet. All comments/help appreciated. Been chasing this for hours.

if (TotOrders > 0)
{
for(int i=TotOrders-1; i>=0; i–)
{
if(OrderSelect(i, SELECT_BY_POS)==true) // Order exists
{
if (OrderSymbol()==Symbol())
PlaySound(“Tick”);
CommentString = Symbol() + " OpenPrice = " + DoubleToString(OrderOpenPrice())
+ " Totorders = " + TotOrders + " var i = " + i;
if(OrderType()==OP_SELL)
{
CommentString += "…Sold " ;
// Set bought stats
}
else
{
CommentString += "…Bought ";
// Do opposite
}
}
}

}
else
{
CommentString += “No Order found”;
PlaySound(“uhoh”);
}

Comment(CommentString) ;
}