Open chart in mt5 per ini file only, if chart is not already open

 

Hi!


I start my mt5 via commandline with a specific ini file. I want it to open a chart, so I add a symbol and period line to the startup section.

When I start the mt5, the chart is opened as expected. When I close the mt5 and open it again, another identical chart for the same symbol is opened. So I have 2 charts for the same symbol and period.

I adds another chart everytime I start the mt5. Is there a way to open the chart only, if it is not already open? mt4 seems to work as expected and opens the chart only once.

Or is there a commandline setting to delete all the charts, when the mt5 is closed?


Thanks in advance for any response,

Andreas

 
daybyter:

Hi,

at each new execution of the *.ini file it is calling to open a new chart, and that is precisely what it does.

Maybe that logic has changed from MT4 to MT5 and that's why it works on one platform and not on the other.

In any case the terminal each time it is executed is opened as you have it at the time of closing, i.e. you do not need to use an *.ini file to force it to open a particular symbol.

 
Miguel Angel Vico Alba #:

Hi,

at each new execution of the *.ini file it is calling to open a new chart, and that is precisely what it does.

Maybe that logic has changed from MT4 to MT5 and that's why it works on one platform and not on the other.

In any case the terminal each time it is executed is opened as you have it at the time of closing, i.e. you do not need to use an *.ini file to force it to open a particular symbol.

Yes, but my idea was to open a chart via remote control, so I can change the symbol in the ini file, before the mt5 is restarted. This new chart should replace the previous chart. Maybe there is a parameter to change the current chart? Or close all charts, before a new chart is opened?


Thanks for your response,

Andreas

 
daybyter #:

Yes, but my idea was to open a chart via remote control, so I can change the symbol in the ini file, before the mt5 is restarted. This new chart should replace the previous chart. Maybe there is a parameter to change the current chart? Or close all charts, before a new chart is opened?

Thanks for your response,

Andreas

I honestly don't know if there is any parameter to force the start of the "terminal64.exe -eurusd" type. At least in the official documentation there is nothing about it.

Maybe for the time being and until a better solution from another user is to close all charts before closing the terminal.

Sorry I can't be of much help. :-(


 

Thanks anyway!


My next idea is to delete all ini files after executing the MT, so the info on the opened charts should be removed?

 
daybyter #:

Thanks anyway!

My next idea is to delete all ini files after executing the MT, so the info on the opened charts should be removed?

In the "common.ini" file you should see something like "ProfileLast=Default".

You could try to create a profile without any chart and have a "common.ini" file configured with "ProfileLast=Profile without charts" and somehow this modified "common.ini" should be replaced by the one created in the last session and then in theory it should open the terminal without any chart. I usually use FreeFileSync for this kind of thing.

Just a thought. I hope it will help you.

Edit: FreeFileSync has the ability to create an executable (*.exe) that automates the replacement of files with a single click. That is, with a *.bat file you could first run this FreeFileSync generated executable that would replace "common.ini" so that it would open the terminal without graphics and then open your *.ini file as usual with a single click.

I am sorry if the possible solution may seem like an incomprehensible mess. I have tried to explain it as best as possible. In my head the idea is perfect. XD

 

Yeah, I was thinking along those line, too. I can create all the ini files new for each MT startup, so it wouldn't be a big issue to create a profile without charts.


Thanks a lot,

Andreas

Reason: