OrdersTotal in a specif pair of currencies

Aug 15, 2016 at 05:08
871 개의 뷰
7 Replies
JHenrique
forex_trader_318221
Apr 07, 2016 부터 멤버   게시물37
Aug 15, 2016 at 05:08
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!!
Aug 20, 2009 부터 멤버   게시물256
Aug 15, 2016 at 06:45 (편집됨 Aug 15, 2016 at 06:48)
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");

Wealth Creation Through Technology
JHenrique
forex_trader_318221
Apr 07, 2016 부터 멤버   게시물37
Aug 15, 2016 at 11:22
Didn't work... Something is wrong with syntax of this code...

=((((((((((
Aug 20, 2009 부터 멤버   게시물256
Aug 16, 2016 at 06:16
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
Wealth Creation Through Technology
JHenrique
forex_trader_318221
Apr 07, 2016 부터 멤버   게시물37
Aug 17, 2016 at 10:30 (편집됨 Aug 17, 2016 at 10:50)
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...
Aug 20, 2009 부터 멤버   게시물256
Aug 17, 2016 at 12:40
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
Apr 08, 2012 부터 멤버   게시물9
Aug 17, 2016 at 15:47
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...
Aug 20, 2009 부터 멤버   게시물256
Aug 17, 2016 at 16:32 (편집됨 Aug 17, 2016 at 16:32)
Here is the code in a working script.

첨부 파일:

Wealth Creation Through Technology
로그인 / 가입하기 to comment
You must be connected to Myfxbook in order to leave a comment
*상업적 사용 및 스팸은 허용되지 않으며 계정이 해지될 수 있습니다.
팁: 이미지/유튜브 URL을 게시하면 게시물에 자동으로 삽입됩니다!
팁: @기호를 입력하여 이 토론에 참여하는 사용자 이름을 자동으로 완성합니다.