Alexey Navoykov: Inline is a relic, in my opinion. The compiler inlines everything fine by itself, so there is no need to overload the code. And in MQL this specifier is nothing at all, added only for compatibility (I don't know what for, if one could declare such a macro by oneself).
And who can guarantee that the compiler has inlined 100500 calls of GetTo() function in a loop, if call is preceded by if(something) and this something is false once in five years?
I find it easier to write inline than to look through the disassembler code to check it.
Vladimir Simakov: Who can guarantee that the compiler will inline 100500 calls to GetTo() in a loop, if the call is preceded by if(something) and this something is false once in five years?
I find it easier to write inline than to look at the disassembler code to check it.
Vladimir Simakov: No. Is there any fundamental complexity there?
Not to be confused with decompiling - these are different things.
I asked a specific question. You gave a specific answer.
And "confusing something with something" is your own fabrication. Please don't worry - I know, and I am not confused, and your other questions are redundant here.
Vladimir Simakov: And who can guarantee that the compiler inlaid 100500 calls to GetTo() function in loop, if this call is preceded by if(something) and this something is false once in five years?
I find it easier to write inline than to look at the disassembler code to check it.
And you managed to optimize a lot with your inlines in Release mode? )
p.s. Weren't you the one who was messing around with alignments the other day?
My friends, can you tell me what it is doing, one month everything was working fine, but I dared to load a deposit and now I got an error - karma is black :(
//+------------------------------------------------------------------+//|значение Regressor Номера буферов: 0 - Up, 1 - Center, 2 - Low |//+------------------------------------------------------------------+double Regressorf(int Bufer,int index)
{
double MA[1];
ResetLastError();
if(CopyBuffer(handle_Regressor,Bufer,index,1,MA)<0)
{
Print("handle_Regressor: Bufer=",Bufer," index=",index);
PrintFormat("Failed to copy data from the handle_Regressor indicator, error code %d",GetLastError());
return(0.0);
}
Print("handle_Regressor: Bufer=",Bufer," index=",index," arr=",MA[0]);
return MA[0];
}
Since July I actively tested everything on a real account under my watchful eyes, there was no error, and now I have it :(
2019.08.1520:51:11.827 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) Failed to copy data from the handle_Regressor indicator, error code 48062019.08.1520:51:58.329 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) handle_Regressor: Bufer=1 index=6272019.08.1520:51:58.329 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) Failed to copy data from the handle_Regressor indicator, error code 48062019.08.1520:52:44.840 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) handle_Regressor: Bufer=0 index=6272019.08.1520:52:44.840 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) Failed to copy data from the handle_Regressor indicator, error code 48062019.08.1520:53:31.350 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) handle_Regressor: Bufer=2 index=6272019.08.1520:53:31.350 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) Failed to copy data from the handle_Regressor indicator, error code 48062019.08.1520:54:17.867 TZ_Sky_and_Ground_V_04_test (Si-9.19,M1) handle_Regressor: Bufer=1 index=627
What can it be? At the same time the indicator itself visually works, re-initialization of the EA solved the problem.
This may be a silly question, but I can't figure out what I'm doing wrong. I started to learn MQL5 and the first problem arose. I cannot use script for immediate opening of an order (buy/sell, any order at all). I just took the ready code from MQL5 Reference and tried to run it (attach the script to the chart window). It did not work. When compiling, no errors occurred, of course. I cannot attach it to the chart. Maybe everything is obvious, but I am at a loss.
#define EXPERT_MAGIC 123456// MagicNumber эксперта//+------------------------------------------------------------------+//| Открытие позиции Buy |//+------------------------------------------------------------------+voidOnStart()
{
//--- объявление и инициализация запроса и результатаMqlTradeRequest request={0};
MqlTradeResult result={0};
//--- параметры запроса
request.action =TRADE_ACTION_DEAL; // тип торговой операции
request.symbol =Symbol(); // символ
request.volume =0.1; // объем в 0.1 лот
request.type =ORDER_TYPE_BUY; // тип ордера
request.price =SymbolInfoDouble(Symbol(),SYMBOL_ASK); // цена для открытия
request.deviation=5; // допустимое отклонение от цены
request.magic =EXPERT_MAGIC; // MagicNumber ордера//--- отправка запросаif(!OrderSend(request,result))
PrintFormat("OrderSend error %d",GetLastError()); // если отправить запрос не удалось, вывести код ошибки//--- информация об операцииPrintFormat("retcode=%u deal=%I64u order=%I64u",result.retcode,result.deal,result.order);
}
Please advise me, what is wrong? Or the code is correct and I'm just a clumsy one?
This may be a silly question, but I can't figure out what I'm doing wrong. I started to learn MQL5 and the first problem arose. I cannot use script for immediate opening of an order (buy/sell, any order at all). I just took the ready code from MQL5 Reference and tried to run it (attach the script to the chart window). It did not work. When compiling, no errors occurred, of course. I cannot attach it to the chart. Maybe all is clear, but I am at a loss.
Please tell me what's wrong? Or the code is correct and I'm just clumsy?
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.
Inline is a relic, in my opinion. The compiler inlines everything fine by itself, so there is no need to overload the code. And in MQL this specifier is nothing at all, added only for compatibility (I don't know what for, if one could declare such a macro by oneself).
Who can guarantee that the compiler will inline 100500 calls to GetTo() in a loop, if the call is preceded by if(something) and this something is false once in five years?
Excuse me, are you disassembling ex4, ex5 codes ?
Artyom, as a moderator please help me with this, I wrote earlier :
"For site administrators:
I couldn't find where, I'm writing here
Need to change the details of the seller in the profile.
how to do this ?
I wrote a message a long time ago in the seller's account, no reply.
maybe there is another way ?
"
Artyom, as a moderator please help me with this, I wrote earlier :
"For site administrators:
I couldn't find where, I'm writing here
Need to change the details of the seller in the profile.
how to do this ?
I wrote a message a long time ago in the seller's account, no reply.
maybe there is another way ?
"
Write to this thread (+ passed your request to the administration):
Excuse me, do you disassemble ex4, ex5 codes?
No. Is there any fundamental complexity there?
I asked a specific question. You gave a specific answer.
And "confusing something with something" is your own fabrication. Please don't worry - I know, and I am not confused, and your other questions are redundant here.
And who can guarantee that the compiler inlaid 100500 calls to GetTo() function in loop, if this call is preceded by if(something) and this something is false once in five years?
And you managed to optimize a lot with your inlines in Release mode? )
p.s. Weren't you the one who was messing around with alignments the other day?
My friends, can you tell me what it is doing, one month everything was working fine, but I dared to load a deposit and now I got an error - karma is black :(
Here is the indicator call from the Expert Advisor
Since July I actively tested everything on a real account under my watchful eyes, there was no error, and now I have it :(
What can it be? At the same time the indicator itself visually works, re-initialization of the EA solved the problem.
Good afternoon!
This may be a silly question, but I can't figure out what I'm doing wrong. I started to learn MQL5 and the first problem arose. I cannot use script for immediate opening of an order (buy/sell, any order at all). I just took the ready code from MQL5 Reference and tried to run it (attach the script to the chart window). It did not work. When compiling, no errors occurred, of course. I cannot attach it to the chart. Maybe everything is obvious, but I am at a loss.
Please advise me, what is wrong? Or the code is correct and I'm just a clumsy one?
Good afternoon!
This may be a silly question, but I can't figure out what I'm doing wrong. I started to learn MQL5 and the first problem arose. I cannot use script for immediate opening of an order (buy/sell, any order at all). I just took the ready code from MQL5 Reference and tried to run it (attach the script to the chart window). It did not work. When compiling, no errors occurred, of course. I cannot attach it to the chart. Maybe all is clear, but I am at a loss.
Please tell me what's wrong? Or the code is correct and I'm just clumsy?