New EA Design Help

 

This code

int TOrders = OrdersTotal();

Alert("TOrders " + TOrders);

opens 5 alerts for 6 open orders, whereas the requirement is for just 1 alert. What am I doing wrong here ?

Okay when I press compile it opens 5 alerts, but when I move between timeframes it opens just 1 alert as required.

My objective is to list all open orders whether opened manually or by the EA.

Okay I tried this code

double yu = MarketInfo(Symbol(),MODE_BID);

Alert(yu);

and it opened 5 alerts for 5 chart windows.

Reason: