As extern you can use:
extern bool Ord = true;
and in the body:
string O_rd;
if(Ord)O_rd="BUY"; else O_rd="SELL";
As extern you can use:
extern bool Ord = true;
and in the body:
string O_rd;
if(Ord)O_rd="BUY"; else O_rd="SELL";
Yes, this is a good idea. But anyway: is it possible to make drop down list with string not bool?
Unfortunately, no.
Yes, this is a good idea. But anyway: is it possible to make drop down list with string not bool?
The only dropdown I know of besides bool is color.
You could do this:
extern color GreenBuy_RedSell = Green;
A lot of EA's also use comments to explain what to enter like this:
extern string OrdComment = "Please enter only BUY or SELL"; extern string Ord = "BUY"; void init() { if (Ord == "BUY" || Ord == "SELL"){} else Alert("Please enter only BUY or SELL for ''Ord'' input"); }
I know that you have solved the problem, but the topic is not left unresolved.
I have attached an image where I used something similar, the user chooses BUY, SELL or Both. But my EA is in Portuguese.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have a variable "Ord" which I use it as extern string:
extern string Ord = "BUY";
It should have only two values: "BUY" or "SELL".
How can I create a list for easyer input when EA starts?
The best would be, if it looks like extern bool variable, where we have TRUE and FALSE.