Download MetaTrader 5
To add comments, please log in or register
Having questions? Ask them on the Forum - traders will help you!
Alfredo Antonetti
1395
Alfredo Antonetti 2014.10.07 14:50 

Hello to everyone! 

How I can obtain one click trading mode? (True or False)

 Is there a way?

 

Thanks

 

Dottor Market 

Carl Schreiber
5930
Carl Schreiber 2014.10.07 15:05  
Tools -> option -> Trade -> Enable One Click Trading?
Alfredo Antonetti
1395
Alfredo Antonetti 2014.10.07 15:37  

Hi gooly!

 

thanks for the reply but I mean the fuction mql4.

 

Exemple:

 

if(One_Click_Trading_Mode() == true) {...}

 

I can't find anything returns me true or false :( 

Alain Verleyen
Moderator
28520
Alain Verleyen 2014.10.07 16:15  
DottorMarket:

Hi gooly!

 

thanks for the reply but I mean the fuction mql4.

 

Exemple:

 

if(One_Click_Trading_Mode() == true) {...}

 

I can't find anything returns me true or false :( 

I don't think it's possible with mql4 code.
Alfredo Antonetti
1395
Alfredo Antonetti 2014.10.08 08:33  
thanks anyway =))
JC
1389
JC 2014.10.08 12:44  
DottorMarket:
thanks anyway =))

There is no good way of doing it, but it is possible. You need to have "Allow DLL imports" turned on in order to use Windows file functions. You then check the status by doing the following:

1. Choose a unique file name for the chart, e.g. something created from its ChartID() 

2. Use ChartSaveTemplate() to create a new template from the current chart, using the unique name

3. Use Windows file functions to open and read the .tpl file which has been created in <terminal-data>\Templates

4. Look for the one_click= line in the file. Its value is either 0 or 1 depending on whether the one-click panel is visible

5. Close the template file, and delete it

I guess that you want to adjust the positioning of a label (or other objects) depending on whether the panel is visible. The method above couldn't reasonably be used on every tick, but you could perhaps use it every 2-5 seconds to check whether the positioning needs to be adjusted.

Alfredo Antonetti
1395
Alfredo Antonetti 2014.10.12 16:07  

Good solution JJC... I try to do!

 I Hope =))

 

Regards 

/
To add comments, please log in or register