Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1132
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
I had to look it up. I haven't found it in MQL5 Reference, but I have found it in OrderSelect Reference for MQL4:
"When using the SELECT_BY_POS parameter, the information is returned in the order in which it was received from the trade server. No sorting of the received list of orders is guaranteed."
Actually, I systematically check whether the lists I use have sorting by ticket number. There have been no cases of its absence. But you can't argue with the reference either, there is no argument. It's just as well it's just as well...
I had to look it up. I haven't found it in MQL5 Reference, but I have found it in OrderSelect Reference for MQL4:
"When using the SELECT_BY_POS parameter, the information is returned in the order in which it was received from the trade server. No sorting of the received list of orders is guaranteed."
Actually, I systematically check whether the lists I use have sorting by ticket number. There have been no cases of its absence. But you can't argue with the reference either, there is no argument. It's just as well it's just as well...
What do you mean "no sorting"? Sort by ticket - there will always be order and there is no contradiction with documentation, it says about sorting by ticket number, not by ticket, these are different things.
Run this code, and read the log
void OnTick()
{
//--
if(flag)
{
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
Print(i," = ",OrderOpenTime());
}
}
flag=false;
}
//-
}
Another problem I've encountered! Don't judge, I've been studying the language for 2-3 weeks, maybe I'm just dumb!
The task on the Expert Advisor is to notify the trader via email every 4 hours, if the free margin on the account has added a certain value.
In the subject of the message you have to write the name of the broker and the traded pair, and in the body of the message "Danger! The drawdown is over the limit. Take the necessary measures".
The compiler is malfunctioning, I'm not good at English and I can't figure out what the error is!
double Sag;
void OnTick()
{
Sag = NormalizeDouble(100-100*(AccountInfoDouble(ACCOUNT_FREEMARGIN)/AccountInfoDouble(ACCOUNT_BALANCE)), 1); //находим процент просадки и округляем до 1 знака
if(Sag > MessageMail && iVolume(NULL,PERIOD_H4,0)<3) //если просадка больше заданного и начата новая свеча на 4ч таймфрейме
{
Alert(Symbol(), ": Просадка = ", Sag, " % ", " > ", MessageMail, " % "); //вывести предупреждение в терминале
//Сюда нужно вставить команду SendMail для отправки сообщения, а что и как не понятно
// пробовал bool SendMail( AccountInfoString(ACCOUNT_COMPANY)|Symbol, "Опасность! Просадка привысила допустимое значение. Примите необходимые меры")
//что то не выходит
}
}
PS: Maybe in general there is an easier solution for this kind of problem, but so far I see it only this way)
Another problem I've encountered! Don't judge, I've been studying the language for 2-3 weeks, maybe I'm just dumb!
The task on the Expert Advisor is to notify the trader via email every 4 hours, if the free margin on the account has added a certain value.
In the subject of the message you have to write the name of the broker and the traded pair, and in the body of the message "Danger! The drawdown is over the limit. Take the necessary measures".
The compiler is malfunctioning, I'm not good at English and I cannot understand what the error is!
double Sag;
void OnTick()
{
Sag = NormalizeDouble(100-100*(AccountInfoDouble(ACCOUNT_FREEMARGIN)/AccountInfoDouble(ACCOUNT_BALANCE)), 1); //находим процент просадки и округляем до 1 знака
if(Sag > MessageMail && iVolume(NULL,PERIOD_H4,0)<3) //если просадка больше заданного и начата новая свеча на 4ч таймфрейме
{
Alert(Symbol(), ": Просадка = ", Sag, " % ", " > ", MessageMail, " % "); //вывести предупреждение в терминале
//Сюда нужно вставить команду SendMail для отправки сообщения, а что и как не понятно
// пробовал bool SendMail( AccountInfoString(ACCOUNT_COMPANY)|Symbol, "Опасность! Просадка привысила допустимое значение. Примите необходимые меры")
//что то не выходит
}
}
PS: Maybe in general there is a simpler solution for such a problem, but so far I see it only this way)
I don't know what it's about.
What are the compiler errors
prıvet.podjalujte pojalusta pozwala why on demo schete ne mogu otkrıt zdelkı