work at the same time with some cross

 
ciao guys first at all thanks in advance for help. i am trying to prepare my personal EA but i have a doubt : with command ordertotal() it's possible to specify the number of pending orders but ..... total orders.... . In this way if I use my EA on some differents cross i cant specify to trade at the same time only one order for each cross i consider. i have tried to use this text: total = ordertotal () ; if total <1 ........ buy ...or sell.... but in this way i trade only one order at the same time . i would like to trade one order for each cross at the same time ....it's possible??? if i use the text total<2 the problem continues...because i could trade 2 orders for Eur/Usd and nothing for Eur/Yen for example. what do you think?? i can solve this problem?? thanks in advance at all ciaoooooooooooooooooooooooooooooo giulio
 
Yes, it's possible. You should create logic variables which will store value *for to the this currency is already opened position*. The variable will accept value true when the position of currency pair will be opened. When you close a position, you will need to appropriate value false.
 
Oh, trading on many crosses at the same time names "multi-currency trading". Sorry my language, I am Russian.
 

Try this

int x;
for(int i=0;i<OrdersTotal();i++)
  {
  OrderSlect(i,SELECT_BY_POS);
  if(OrderSymbol()==Symbol())
    {
     x++;
     break;
    }
  }
if(x==0)//it means no orders for your currency
 
ok Roger i try!!! thankssssssssssssssss in fact i mean the possibility to do multi currency trading i will inform you tomorrow if it's ok grazie :-))
 
giulioron wrote >>
ok Roger i try!!! thankssssssssssssssss in fact i mean the possibility to do multi currency trading i will inform you tomorrow if it's ok grazie :-))

Good luck and remember you can't test multi-currency ea's in the tester! So don't be disappointed if you tried and it didn't work.

Best you can do is run your ea on a short time frame 1 or 5 min on a live demo, that way you should get enough possible trades to see if it works.

Let us know how you make out!

Keith

 
kminler wrote >>

Good luck and remember you can't test multi-currency ea's in the tester! So don't be disappointed if you tried and it didn't work.

Best you can do is run your ea on a short time frame 1 or 5 min on a live demo, that way you should get enough possible trades to see if it works.

Let us know how you make out!

Keith

ciao Kminler. why cant i try my EA in multicurrency with tester??? i can tester the first one andh then the second one.... then i sum the results. no??

anyway at the moment i am able to open some order with this:

int x;
for(int i=0;i<OrdersTotal();i++)
  {
  OrderSlect(i,SELECT_BY_POS);
  if(OrderSymbol()==Symbol())
    {
     x++;
     break;
    }
  }
if(x==0)//it means no orders for your currency

but i use two different type of EA ( one for Eur/Usd and one for Eur/Gbp ) and obviously two different open order conditions and 2 different close order conditions.

with the text above i can open some order simultaneasly but how can i close them according my rules??

if i use :

if x==1

....... close order conditions

it's wrong?

Reason: