How we can get the last lot volume of the last order losed
You can try with a function like this :
{
datetime lastTime = 0;
double lastLots = 0;
for(int i=OrdersHistoryTotal()-1; i>=0; i--)
{
if (OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)==false) break;
if (magicNumber!=0)
if (OrderMagicNumber() != magicNumber) continue;
if (OrderSymbol() != Symbol()) continue;
if (OrderCloseTime() <= lastTime) continue;
lastTime = OrderCloseTime();
lastLots = OrderLots();
}
return(lastLots);
}It will look for the last closed order and return the volume of it (PS: it is searching in the set of already closed orders, currently opened orders are not taken into account with this finction)
hi, i try to make expert and i want to get your advice to how i can to get the last lot volume of the last order lose
thank you ... it is really working good
hi,
i try to make expert and i want to get your advice to how i can to get the last lot volume of the last order lose