changing symbol using PostMessageA function

 

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?

 
The answer is on the forum, try to search it.
 
  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
 

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.


 
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?

Reason: