Download MetaTrader 5
To add comments, please log in or register
Have you developed a profitable strategy? Share it with millions of traders via Signals!
mqltools
25
mqltools 2010.02.09 04:30 

I'm modifying PositionInfoSample.mq5, and I added comment display capability.

The following code DOESN'T work:

const string a = m_position.InfoString(POSITION_COMMENT);
m_label_info[14].Description(a); 

The displayed result is: "Comment: 1".

The following code, however, does work: 

m_label_info[14].Description(m_position.InfoString(POSITION_COMMENT));

The position's comment is displayed correctly (as string).

What's the reason for this? If this behavior is correct, then, how to display a comment using variable indirection?

I'm attaching the whole PositionInfoSample.mq5 with my (albeit very small) modifications. 

Rashid Umarov
Admin
11571
Rashid Umarov 2010.02.09 12:53  
What do you mean? There is just our code without your modifications here, we have checked and it works properly. Please, provide mode detailed information.

mqltools
25
mqltools 2010.02.09 13:46  

I'm sorry! I didn't notice that the new metatrader writes everything in user's local folder. I just uploaded code from /Scripts from Program Files Metatrader's folder.

I'm attaching the correct version. 

(it's in the InfoToChart function) 

/
To add comments, please log in or register