Advertisement
Edit Your Comment
OrdersTotal in a specif pair of currencies

forex_trader_318221
Tham gia từ Apr 07, 2016
37bài viết
Aug 15, 2016 at 05:08
Tham gia từ Apr 07, 2016
37bài viết
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!!
Tham gia từ Aug 20, 2009
256bài viết
Aug 15, 2016 at 06:45
(đã sửa Aug 15, 2016 at 06:48)
Tham gia từ Aug 20, 2009
256bài viết
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

forex_trader_318221
Tham gia từ Apr 07, 2016
37bài viết
Aug 15, 2016 at 11:22
Tham gia từ Apr 07, 2016
37bài viết
Didn't work... Something is wrong with syntax of this code...
=((((((((((
=((((((((((
Tham gia từ Aug 20, 2009
256bài viết
Aug 16, 2016 at 06:16
Tham gia từ Aug 20, 2009
256bài viết
Replace the ' around the EURGBP with double quotes("). The website seems to change my original quotes.
Also the Number_of_Orders should be declared as int
Also the Number_of_Orders should be declared as int
Wealth Creation Through Technology

forex_trader_318221
Tham gia từ Apr 07, 2016
37bài viết
Aug 17, 2016 at 10:30
(đã sửa Aug 17, 2016 at 10:50)
Tham gia từ Apr 07, 2016
37bài viết
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...
Tham gia từ Aug 20, 2009
256bài viết
Aug 17, 2016 at 12:40
Tham gia từ Aug 20, 2009
256bài viết
The code is solid. I have tested it via a script. You need to be more specific as to the error that it is giving you. Alternatively, post the mql file and I will have a look at it.
Wealth Creation Through Technology

forex_trader_72824
Tham gia từ Apr 08, 2012
9bài viết
Aug 17, 2016 at 15:47
Tham gia từ Apr 08, 2012
9bài viết
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...
Tham gia từ Aug 20, 2009
256bài viết
Aug 17, 2016 at 16:32
(đã sửa Aug 17, 2016 at 16:32)
Tham gia từ Aug 20, 2009
256bài viết
Here is the code in a working script.
Wealth Creation Through Technology

*Nghiêm cấm sử dụng cho mục đích thương mại và spam, nếu vi phạm có thể dẫn đến việc chấm dứt tài khoản.
Mẹo: Đăng ảnh/url youtube sẽ tự động được nhúng vào bài viết của bạn!
Mẹo: Dùng @ để tự động điền tên người dùng tham gia vào cuộc thảo luận này.