MQL) How to know order info in all charts by currency-pair?

 

Hi, I want to know information for open orders by currency in all charts.

I have running the same EA in several charts

1. EU chart (TF=M1)

2.GJ chart (TF=M15)

3.UJ chart (TF=H1)

4. EU chart (TF=H1)

5. GJ chart (TF=H4)

I can use

   OrderSelect(cnt,SELECT_BY_POS);
   
    if(OrderSymbol() ==Symbol())


But this is for each chart, right?

How can I know open order info for all chart?

For example,

EU current profit total is *****..

GU current profit totai is ****...



 
kajironpu: But this is for each chart, right? How can I know open order info for all chart?
  1. Wrong. That is for the current chart's symbol. You could have multiple charts open, same symbol different timeframes.
  2. The OrderSelect loop is for all orders, any or no charts.
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
          Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
          MagicNumber: "Magic" Identifier of the Order - MQL4 Articles
 
Thanks,
Symbol()


is just for EA attached currency....


So how can I count by symbol (not EA attached)? I mean all currency pairs that EA attached.

for (int i=0; i<OrdersTotal(); i++){ 
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) 

 if (OrderSymbol() =?????

This is not true....

for (int i=0; i<OrdersTotal(); i++){ 
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) 

 if (OrderSymbol()== OrderSymbol()){ orders++;   }
 
kajironpu: So how can I count by symbol
Go through the list and get all unique symbols. Go through the list and update your array per symbol