How to select orders by symbol and by direction(buy/long/flat) in a concrete symbol

 
Hello Folks,

I am pretty new to MT4 EA programming so I would liek to ask you some little support.

My attempt is to can select the already opened orders in MT4, by symbol, and then by direction (buy/long/flat).


May you show me please an example of structuring the code, in order that it may return the opened orders by a specific symbol, and then by its direction?


Thank you very much