If you add comments to each line, it will be more interesting:
inputint MetaQuotes1 = 30; // Описание входного параметра 1 inputbool MetaQuotes2 = true; // Описание входного параметра 2 inputdouble MetaQuotes3 = 20.3; // Описание входного параметра 3 inputstring MetaQuotes4 = "Corp"; // Описание входного параметра 4
And if you make another enumeration and use it instead of a bool, it's even more interesting:
enum enumYN { enYes = 1, // Да enNo = 0, // Нет };
inputint MetaQuotes1 = 30; // Описание входного параметра 1 input enumYN MetaQuotes2 = enYes; // Описание входного параметра 2 inputdouble MetaQuotes3 = 20.3; // Описание входного параметра 3 inputstring 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:
enum enumYN { enYes = 1, // Да enNo = 0, // Нет };
inputint MetaQuotes1 = 30; // Описание входного параметра 1 input enumYN MetaQuotes2 = enYes; // Описание входного параметра 2 inputdouble MetaQuotes3 = 20.3; // Описание входного параметра 3 sinputstring 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.
Mikhail Goryunov: 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.
wishmast: why do they write this as an assignment? int tik=OrderSend
Because
Возвращаемое значение
Возвращает номер тикета, который назначен ордеру торговым сервером или -1 в случае неудачи. Чтобы получить информацию об ошибке, необходимо вызвать функцию GetLastError().
The value of this variable will then determine what you do next. For example
double ask=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),digits); 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:
sinputstring MetaQuotes4 = "Corp"; // Описание входного параметра 4
Unfortunate example, lowercase parameters will not be involved in optimization in any way.
Vitalie Postolache: Unfortunate example, lowercase parameters will not be involved in optimisation in any way.
I did not choose them by success/failure. I just showed you an example of the code I've written above. The example was clear. That's what I was trying to do.
Artyom Trishkin: 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.
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?