Hi, I try to implement an indicator which is showing my outstanding orders for a specific EA. But I am trying as well to get the total lotsize in case there are more outstanding orders for this EA, but I am doing something wrong because it's not returning any value for the OrderLots. Can anyone help me to solve this issue?
The code is:
int start()
{
int i,j;
int OrdersPerEA=0;
int OrderSize=0;
int counted_bars=IndicatorCounted();
int bars=Bars;
int limit=Bars-counted_bars ;
int OpenOrders=OrdersTotal();
for(i = limit; i>=0; i--)
{
OrdersPerEA=0;
for(j=0; j<=OpenOrders; j++)
{
if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES)==true)
{
if(OrderMagicNumber()== 12222234)
{
OrdersPerEA++;
OrderSize = OrderLots();
}
}
}
Print("i = ", DoubleToStr(i,0));
Print("Bars = ", bars);
Print("Limit = ", limit);
Print("Open Orders = ", OpenOrders);
Print("Open Orders MB_EA = ", OrdersPerEA);
Print("Aantal Open Lots = ", OrderSize);
}
return(0);
}
Hi, I try to implement an indicator which is showing my outstanding orders for a specific EA. But I am trying as well to get the total lotsize in case there are more outstanding orders for this EA, but I am doing something wrong because it's not returning any value for the OrderLots. Can anyone help me to solve this issue?
The code is: