Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 47

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If you add comments to each line, it will be more interesting:
input bool MetaQuotes2 = true; // Описание входного параметра 2
input double MetaQuotes3 = 20.3; // Описание входного параметра 3
input string MetaQuotes4 = "Corp"; // Описание входного параметра 4
And if you make another enumeration and use it instead of a bool, it's even more interesting:
{
enYes = 1, // Да
enNo = 0, // Нет
};
input int MetaQuotes1 = 30; // Описание входного параметра 1
input enumYN MetaQuotes2 = enYes; // Описание входного параметра 2
input double MetaQuotes3 = 20.3; // Описание входного параметра 3
input string MetaQuotes4 = "Corp"; // Описание входного параметра 4
and sinput allows you to exclude a variable from the list of variables for optimization. For example, MetaQuotes4 variable in this context is not necessary for optimization and it can be excluded:
{
enYes = 1, // Да
enNo = 0, // Нет
};
input int MetaQuotes1 = 30; // Описание входного параметра 1
input enumYN MetaQuotes2 = enYes; // Описание входного параметра 2
input double MetaQuotes3 = 20.3; // Описание входного параметра 3
sinput string MetaQuotes4 = "Corp"; // Описание входного параметра 4
There is nothing wrong with this, we just needed to add text to make it clear during optimization from and to which parameter and step.
There is nothing wrong with this, all that was required was to add text to make it clear when optimising from and to which parameter and step.
why do they write this as an assignment? int tik=OrderSend
Возвращает номер тикета, который назначен ордеру торговым сервером или -1 в случае неудачи. Чтобы получить информацию об ошибке, необходимо вызвать функцию GetLastError().
The value of this variable will then determine what you do next. For example
price=NormalizePrice(_Symbol,ask+Distance*_Point);
t=OrderSend(_Symbol,OP_BUYSTOP,volume,price,Slippage,0,0,CommentOrder,Magic,0,clrBlue);
if(t<0)
{
error=GetLastError();
rezult=StringConcatenate(_Symbol,": error open order ",DoubleToString(volume,2)," ",TypeToStr(type)," №- ",error," ",ErrorDescription(error));
Print(rezult);
}
else
{
tiket=t;
rezult=StringConcatenate(_Symbol,": open order ",t," ",DoubleToString(volume,2)," ",TypeToStr(type));
Print(rezult);
SendNotification(rezult);
}
....
and sinput allows you to exclude a variable from the list of variables to be optimised. For example, the variable MetaQuotes4 is not needed for optimisation in this context and can be excluded:
sinput string MetaQuotes4 = "Corp"; // Описание входного параметра 4
Unfortunate example, lowercase parameters will not be involved in optimisation in any way.
I didn't pick it up by success/failure. I just showed you an example of the above code. The example was clear. That's what I was trying to do.
Absolutely right, you can do that as well.
Absolutely right, you can do that too
Here is a construction.
doubleiLowest(string symbol,ENUM_TIMEFRAMES timeframe,int ne)
Question: what type doesENUM_TIMEFRAMES have?
Here is a construction.
doubleiLowest(string symbol,ENUM_TIMEFRAMES timeframe,int ne)
Question: what type doesENUM_TIMEFRAMES have?