Data input window in scripts

 

Hello everybody,

I'm a newbie on this forum. I've just started to develop my tools for trading in Meta Trader 4.

I'd like to write a script that will prompt user for data, i.e. open a window to input data.

For example: Script that will calculate max. lot size assuming x% risk of account for given SL. Script should open a window for data input to write different risk value in % i.e 2, 2.5, 3, 5, etc, and SL value.

I was searching in help, MQL4 Book and in forum topics, but I didn't find any function to open an input data window. Is it possible in MQL4?

Till now I wrote the risk % and SL values directly in script code, compile it and run. If I want calculate diffrent risk % for different SL I need to change values in the script code, compile and run again.

But I don't like it.

Do you have any idea for such a window like in the One-ClickTrading EA added to the last version of MetaTrader4? 

 
marky_74:

Hello everybody,

I'm a newbie on this forum. I've just started to develop my tools for trading in Meta Trader 4.

I'd like to write a script that will prompt user for data, i.e. open a window to input data.

For example: Script that will calculate max. lot size assuming x% risk of account for given SL. Script should open a window for data input to write different risk value in % i.e 2, 2.5, 3, 5, etc, and SL value.

I was searching in help, MQL4 Book and in forum topics, but I didn't find any function to open an input data window. Is it possible in MQL4?

Till now I wrote the risk % and SL values directly in script code, compile it and run. If I want calculate diffrent risk % for different SL I need to change values in the script code, compile and run again.

But I don't like it.

Do you have any idea for such a window like in the One-ClickTrading EA added to the last version of MetaTrader4? 

 


On top of script, write #property show_inputs. Then write the extern input

#property show_inputs

extern int     My_Integer = 1;
extern double  Double_Bubble = 2.0;
extern bool    Bool_Linger = True;
extern string  Say_Something = "Thing";
 
phi.nuts:


On top of script, write #property show_inputs. Then write the extern input

 


Wow, it works!

And it's really easy to do.

I was looking for wrong function like "window", "get", "input" or something similar.

Thanks a lot! :) 

 

I'm getting these errors setting simple Inputs


I can't seem to figure out why this is happening with with the following two lines of code?  Would appreciate some help. Thanks.


input double IntTPDeviations = 1.0;

input double IntSLDeviations = 1.0;

 
Gary Clifford Townsend # :


I can't seem to figure out why this is happening with with the following two lines of code?  Would appreciate some help. Thanks.


input double IntTPDeviations = 1.0;

input double IntSLDeviations = 1.0;

The problem is not in these lines. To solve the problem, it is necessary to see the whole code.

 
The problem is in the code above the line. Always post all relevant code (using Code button) or attach the source file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem
Reason: