На баре может быть только одна сделка 'вход в рынок' (это внутренний параметр, он не вынесен во входные параметры и это не имеет отношения к параметру ' Only one positions'). При работе в режиме 'внутри бара' ('Search signals, in seconds' больше или равно '10') текущий бар - бар #0, при работе в режиме 'только в момент рождения нового бара'...
How do I understand you, I ask about lots, you advise me to look at price normalisation.
I have already spent a lot of time, I can't understand what this is all about. I have done what they write. It turns out here too do not know how to help.
bool CheckMoneyForTrade(double lots,ENUM_ORDER_TYPE type)
{
//--- получим цену открытияMqlTick mqltick;
SymbolInfoTick(symb.Name(),mqltick);
double price=mqltick.ask;
if(type==ORDER_TYPE_SELL)
price=mqltick.bid;
//--- значения необходимой и свободной маржиdouble margin,free_margin=AccountInfoDouble(ACCOUNT_MARGIN_FREE);
//--- вызовем функцию проверкиif(!OrderCalcMargin(type,symb.Name(),lots,price,margin))
{
//--- что-то пошло не так, сообщим и вернем falsePrint("Error in ",__FUNCTION__," code=",GetLastError());
return(false);
}
//--- если не хватает средств на проведение операцииif(margin>free_margin)
{
//--- сообщим об ошибке и вернем falsePrint("Not enough money for ",EnumToString(type)," ",lots," ",symb.Name()," Error code=",GetLastError());
return(false);
}
//--- проверка прошла успешноreturn(true);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I read what checks to pass. Why are you writing this to everyone. I have a volume question, what's wrong.
Reading and doing are two big differences.
The treatment method: in addition to reading, do what is written. Repeat until you understand the error.
Added: To study codeIntersection 2 iMA Choosing Strategies, functions OpenBuy, OpenSell, LotCheck.
How do I understand you, I ask about lots, you advise me to look at price normalisation.
I've already spent a lot of time, I can't understand what's wrong. I have done what they write. It turns out here too do not know how to help.
What to do?
How do I understand you, I ask about lots, you advise me to look at price normalisation.
I have already spent a lot of time, I can't understand what this is all about. I have done what they write. It turns out here too do not know how to help.
What to do?
Forum on trading, automated trading systems and strategy testing
MQL5: Validation :-( I have already searched my head in depth what it is and how it is solved.
Vladimir Karputov, 2020.03.10 18:36
You have read and executed - are two big differences.
Your method of treatment: Do what you read, but also read what is written. Repeat until you understand the error.
Added: to study codeIntersection 2 iMA Choosing Strategies, functions OpenBuy, OpenSell, LotCheck.
I inserted your LotCheck function.
Here is the result
Can anyone help? I've already tried everything.
Can anyone help? I've tried everything.
Where's the code? Paste the code using the
button
Can anyone help? I've already tried everything.
How do you close positions?