OrderSelect 2 most recently opened positions
for(i=0; i<=1; i++)
{
OrderSelect(i,SELECT_BY_POS);
Print("Order Open Price for ",OrderTicket()," is ",OrderOpenPrice());
//.....or something else with these values
}
for(i=0; i<=1; i++)
[...]
Isn't that going to return the prices of the two oldest positions, not the two most recent ones? In addition, it's not necessarily taking account of (a) pending orders, and (b) orders placed by other EAs.
Depending on whether "opened" means "filled" or just "placed", then a fuller answer is going to be something like the opposite of 'Selecting Order from 2 same symbols'.
thanks!