Download MetaTrader 5

changing symbol using PostMessageA function

To add comments, please log in or register
Take active part in the life of the community. Improve your rating!
Zoltan Laszlo Ferenci
28
Zoltan Laszlo Ferenci 2013.11.25 16:35 

Hi,

I have got a request that requires changing the symbol on a chart. I am almost sure it's possible with the PostMessageA function, but not all possible commands are known. Do anyone knows a command that allows symbol change?

Alain Verleyen
Moderator
30752
Alain Verleyen 2013.11.25 17:31  
The answer is on the forum, try to search it.
whroeder1
14532
whroeder1 2013.11.25 17:38  
  1. You're almost sure? Since pairs are broker specific and new ones (metals) are being added I doubt there are ANY. Certainly none listed in #define's for known commands that can be used for PostMessageA() - MQL4 forum
  2. Most likely you're going to have to Foreground the chart, send key press enter, pause, send E U R U S D enter, wait)
  3. KISS, open multiple pairs and EA only processes that pair. Nothing needs to be coded.
  4. or just trade the other pair, can't use any predefined variables and must handle HISTORY UPDATE
Zoltan Laszlo Ferenci
28
Zoltan Laszlo Ferenci 2013.12.02 13:34  

Dear angevoyageur, thank you for informing me that there is an answer, and good that you are so lucky that you have found it unlike me. Would you be so kind to tell me where is it? You may give me a link or a keyword I need to use for search.

Dear WHRoeder, thank you for the answer, it's good idea, if there are no other solution. I think there should be a simpler solution, for example the custom indicator launch is possible with this:

// SendMessageA(hwnd, RegisterWindowMessageA("MetaTrader4_Internal_Message"), 15, CustomIndicatorName); // Custom indicators launch.

And this gives the indicator name as a string. The symbol change would be the same type of action. I hope the moderator will be so kind to answer.


Alain Verleyen
Moderator
30752
Alain Verleyen 2013.12.02 14:17  
ferenci84:

Dear angevoyageur, thank you for informing me that there is an answer, and good that you are so lucky that you have found it unlike me. Would you be so kind to tell me where is it? You may give me a link or a keyword I need to use for search.

Dear WHRoeder, thank you for the answer, it's good idea, if there are no other solution. I think there should be a simpler solution, for example the custom indicator launch is possible with this:

// SendMessageA(hwnd, RegisterWindowMessageA("MetaTrader4_Internal_Message"), 15, CustomIndicatorName); // Custom indicators launch.

And this gives the indicator name as a string. The symbol change would be the same type of action. I hope the moderator will be so kind to answer.


If I knew where is the reply, I would post it of course. I am pretty sure I read at least 1 post about your issue, but I have to search it like you. I will do it when I have enough time.

EDIT: See if this is what you need?

To add comments, please log in or register