Edit Your Comment
OrdersTotal in a specif pair of currencies

forex_trader_318221
Membre depuis Apr 07, 2016
posts 37
Aug 15, 2016 at 05:08
Membre depuis Apr 07, 2016
posts 37
Hi guys!
I have another problem…
I want make this:
if(the number of orders in EURGBP < 2){do it…}
I know the function OrdersTotal(), but I don’t want to know the total, I want to know the total in EURGBP! So, how can I do it?
Thanks again!!
I have another problem…
I want make this:
if(the number of orders in EURGBP < 2){do it…}
I know the function OrdersTotal(), but I don’t want to know the total, I want to know the total in EURGBP! So, how can I do it?
Thanks again!!
Membre depuis Aug 20, 2009
posts 256
Aug 15, 2016 at 06:45
(édité Aug 15, 2016 at 06:48)
Membre depuis Aug 20, 2009
posts 256
Use this function :-
int Trade_Count(int My_Magic, string my_symbol)
{
int
counter = 0;
for(int i = OrdersTotal()-1;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS)>0){
if(StringFind(OrderSymbol(),my_symbol,0)>-1){
if(OrderMagicNumber()==My_Magic)counter++;
}
}
}
return(counter);
}
Function call would be something like :-
Number_of_Orders = Trade_Count(12345, "EURGBP");
int Trade_Count(int My_Magic, string my_symbol)
{
int
counter = 0;
for(int i = OrdersTotal()-1;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS)>0){
if(StringFind(OrderSymbol(),my_symbol,0)>-1){
if(OrderMagicNumber()==My_Magic)counter++;
}
}
}
return(counter);
}
Function call would be something like :-
Number_of_Orders = Trade_Count(12345, "EURGBP");
Wealth Creation Through Technology
Membre depuis Aug 20, 2009
posts 256

forex_trader_318221
Membre depuis Apr 07, 2016
posts 37
Aug 17, 2016 at 10:30
(édité Aug 17, 2016 at 10:50)
Membre depuis Apr 07, 2016
posts 37
I tried again, but, without successful...
I think the problem is in the word "my_symbol". I substitued it for EURGBP, 'EURGBP' and "EURGBP" (with and without string before) and the code continues to give problem...
I think the problem is in the word "my_symbol". I substitued it for EURGBP, 'EURGBP' and "EURGBP" (with and without string before) and the code continues to give problem...
Membre depuis Aug 20, 2009
posts 256

forex_trader_72824
Membre depuis Apr 08, 2012
posts 9
Aug 17, 2016 at 15:47
Membre depuis Apr 08, 2012
posts 9
JHenrique posted:
Hi guys!
I have another problem…
I want make this:
http://monitorfx.pl/
if(the number of orders in EURGBP < 2){do it…}
I know the function OrdersTotal(), but I don’t want to know the total, I want to know the total in EURGBP! So, how can I do it?
Thanks again!!
Didn't work...

*Lutilisation commerciale et le spam ne seront pas tolérés et peuvent entraîner la fermeture du compte.
Conseil : Poster une image/une url YouTube sera automatiquement intégrée dans votre message!
Conseil : Tapez le signe @ pour compléter automatiquement un nom dutilisateur participant à cette discussion.