How to code EA to only print margin utilized by symbol?

 
Hi

I need help with coding in EA to 'print net margin utilized for a symbol' 

If I have EAs running on 3 different currency charts, the EA on each of those charts should only print the margin utilized by that symbol. 

Taking on new orders for that symbol would have EA on its chart to recalculate and print the new utilized margin.


My current dashboard information display is coded like this.


p("Equity / Balance: " + DoubleToString(AccountEquity(), 2) + " / " + DoubleToString(AccountBalance(), 2));

p("Margin / Free margin: " + DoubleToString(AccountMargin(), 2) + " / " + DoubleToString(AccountFreeMargin(),2));


Currently the Margin figure is showing a collective Account Margin (total Margin) for all different currency pairs on order. So, I see the same Margin status on EAs dashboard when I switch to any other currency pair.

How could this be coded to only show only the margin of the respective currency?

Meaning, if I view EURUSD it should show the margin of only all EURUSD orders in trade. And if I switch over to GBPUSD, it will show only margin for GBPUSD trades.

Rgds

AMK
 

Hope someone could help.

Thank you