Download MetaTrader 5

Function Comment() doesn't show information of MarketInfo() function

To add comments, please log in or register
Store your source codes in MQL5 Storage. It is secure!
Victor
11
Victor 2014.01.02 10:04 

Hello everybody,

This is my new post, I'm really new at this community. I'm still learning but well, this is my problem: I recently discovered the Comment() function that was and is really helpful for me. I've been using it since I discovered it without any problems. On the one hand, I'm a fan of commenting things in the chart while programming to see "how it works". On the other hand I'd like to show the return of the function MarketInfo. Precisely, the simple code is the following:

Comment("Minimum pips: ", MarketInfo(Symbol(), MODE_STOPLEVEL));

I've tried changing Symbol() with "GBPJPY" and other currencies; doesn't work. Reading other posts I thought it was due to the testing mode; I've tried this live and it doesn't work neither. All I get while commenting is the result 0, but it's not true (it's supposed to be 70 at GBPJPY, I think). I have to say that I used the MarketInfo function to calculate a maximun lote size succesfully this way:

double MaxLots = NormalizeDouble(AccountFreeMargin()/MarketInfo(Symbol(), MODE_MARGINREQUIRED), 2);


Could anybody help me? Thanks a lot in advance.

PD: I've searched in the forum before writing this new post. If there's something similiar and I didn't find it I must say I'm sorry.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.01.02 10:44  
klash:

Hello everybody,

This is my new post, I'm really new at this community. I'm still learning but well, this is my problem: I recently discovered the Comment() function that was and is really helpful for me. I've been using it since I discovered it without any problems. On the one hand, I'm a fan of commenting things in the chart while programming to see "how it works". On the other hand I'd like to show the return of the function MarketInfo. Precisely, the simple code is the following:

I've tried changing Symbol() with "GBPJPY" and other currencies; doesn't work. Reading other posts I thought it was due to the testing mode; I've tried this live and it doesn't work neither. All I get while commenting is the result 0, but it's not true (it's supposed to be 70 at GBPJPY, I think). I have to say that I used the MarketInfo function to calculate a maximun lote size succesfully this way:

Is "GBPJPY" the correct symbol name ? many Brokers add a character to the end, for example GBPJPYm or GBPJPY. please open a GBPJPY chart and check carefully . . .
Victor
11
Victor 2014.01.02 11:58  
RaptorUK:
Is "GBPJPY" the correct symbol name ? many Brokers add a character to the end, for example GBPJPYm or GBPJPY. please open a GBPJPY chart and check carefully . . .


Hello RaptorUK,

First of all, thanks for your quickly answer. The answer is yes, that's the correct symbol name (checked a few times), but it shouldn't be a problem if I use the Symbol() function. The point is that when I use the MarketInfo to calculate the maximum lot size in the code as I wrote before it does work (checked), but when I try to comment the result of the MarketInfo() function with the Comment() function it seems that the result is 0, and it isn't. In other words, when I use

Comment("Minimum pips: ", MarketInfo(Symbol(), MODE_STOPLEVEL));
what I read in the chart is: "Minimum pips: 0". What is the problem? It's something really strange.
whroeder1
14514
whroeder1 2014.01.02 14:18  
Your broker is a ECN. there is no minimum. Zero is the correct value.
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.01.02 14:37  
klash:

Hello everybody,

This is my new post, I'm really new at this community. I'm still learning but well, this is my problem: I recently discovered the Comment() function that was and is really helpful for me. I've been using it since I discovered it without any problems. On the one hand, I'm a fan of commenting things in the chart while programming to see "how it works". On the other hand I'd like to show the return of the function MarketInfo. Precisely, the simple code is the following:

I've tried changing Symbol() with "GBPJPY" and other currencies; doesn't work. Reading other posts I thought it was due to the testing mode; I've tried this live and it doesn't work neither. All I get while commenting is the result 0, but it's not true (it's supposed to be 70 at GBPJPY, I think). I have to say that I used the MarketInfo function to calculate a maximun lote size succesfully this way:

If it is 70 it will tell you when you try to place a pending order trade manually . . . and at the bottom of the window it will say "Open price you set must differ from market price by at least 70 pips." the pips thing is a typo, it means points.

Victor
11
Victor 2014.01.03 11:13  

Hello again,

Thanks a lot, RaptorUK and WHRoeder, you were so true. I tried to open manually a pending order and could notice that there wasn't a minimum pips amount. It is, the Comment() function was doing it right. Again, thanks for your answers and help.

To add comments, please log in or register