//+------------------------------------------------------------------+int deinit()
{
return(0);
}
//+------------------------------------------------------------------+int start()
{
f1(); //Как сделать, что-бы после вызова функции, программа могла остановиться?Alert("Есть сигнал"); // И до этого места работа программы бы не дошлаreturn(0);
}
//+------------------------------------------------------------------+ int f1()
{
return(f2());
}
//+------------------------------------------------------------------+ int f2()
{
return(deinit()); //Тут, по задумке, нужно остановить работу всей программы
}
//+------------------------------------------------------------------+
Or, from a called function, the operation of the program cannot be stopped? (Example code to be used in the indicator)
Stop means to stop the execution of the start function - from the called function. Like return(0).
About deinit, I know, that's why I don't know how to solve this puzzle. Apparently you can't do it that way.
Then what prevents you from returning (-1) or something else with this function and making a call to this function in start() with a check? for example, like this:
int start()
{
if (f1() == -1) return (0);
Alert("Есть сигнал"); // И до этого места работа программы бы не дошлаreturn(0);
}
//+------------------------------------------------------------------+ int f1()
{
if (все плохо) return (-1); else return(0);
}
Then what prevents you from returning (-1) or something else with this function and making a call to this function in start() with a check? for example like this:
//+------------------------------------------------------------------+int start()
{
if(f1() < 0) return(0);
Alert("Есть сигнал"); // И до этого места работа программы бы не дошлаreturn(0);
}
//+------------------------------------------------------------------+ int f1()
{
return(f2());
}
//+------------------------------------------------------------------+ int f2()
{
return(-1); //Тут, по задумке, нужно остановить работу всей программы
}
//+------------------------------------------------------------------+
I understand you, just wanted to avoid unnecessary movements in the code, clarified. Thanks for the example!
Good evening, I've encountered that the trading robot doesn't close positions, about once in 50, when it reaches a profit. It then has to close everything, pending orders and all, and set up again. Not closing creates order confusion and drawdown.
So imagine, sometimes it turns out that an order closed at takeprofit, Clowes Price - order closing price - equals zero!!!!!
See the fifth line in the screenshot below, it is the fifth line, the order closed on takeprofit. And in the ninth line from the bottom Closing price of the order is equal to zero!!!!!
It seems there is nothing particularly complicated in the code... I'll show it to you right now.
When I place an order, I save the time in the wremjapomnim window. As soon as any order is closed at currentprofit, I delete all orders and again remember the time in the wremjapomnim pyrimen and set them.
The alert is in the second and third lines of the code and writes everything in the log, including the fact thatOrderClosePrice( ) of order 49 is equal to zero.
Tell me how to track the formation of a fractal in the EA. I need to open an order after the formation of a new fractal. I do not know how this indicator works; it has some kind of upper line and some kind of lower line.
If, for example, a fractal is formed and the price breaks that minimum, will the fractal be re-drawn or will I just add another fractal?
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.
Is my case such a difficult one?
double ExtVolumesBuffer[];you are right about the location. You should specify the size of the array before using it. Or make it another buffer
Or, from a called function, the program cannot be stopped? (Example code, to be used in the indicator)
return(deinit());What do you mean by stop? remove the EA/indicator from the graph?
about deinit():
the call of deinit does not lead to the deactivation of the indicator/indicator, but the deactivation leads to the call of deinit
What do you mean by stop? remove the EA/indicator from the graph?
about deinit():
it is not the call to deinit that causes the indicator/expert to be disabled, it is the disabling that causes deinit to be called
Stop means to stop the execution of the start function - from the called function. Like return(0).
About deinit, I'm aware of it, that's why I don't know how to solve this conundrum. Apparently you can't do it that way.
Stop means to stop the execution of the start function - from the called function. Like return(0).
About deinit, I know, that's why I don't know how to solve this puzzle. Apparently you can't do it that way.
Then what prevents you from returning (-1) or something else with this function and making a call to this function in start() with a check? for example, like this:
Then what prevents you from returning (-1) or something else with this function and making a call to this function in start() with a check? for example like this:
you are right about the location. You should specify the size of the array before using it. Or make it another buffer
dkfl.zrjdktdbx 09.12.2011 16:56
Good evening, I've encountered that the trading robot doesn't close positions, about once in 50, when it reaches a profit. It then has to close everything, pending orders and all, and set up again. Not closing creates order confusion and drawdown.
So imagine, sometimes it turns out that an order closed at takeprofit, Clowes Price - order closing price - equals zero!!!!!
See the fifth line in the screenshot below, it is the fifth line, the order closed on takeprofit. And in the ninth line from the bottom Closing price of the order is equal to zero!!!!!
It seems there is nothing particularly complicated in the code... I'll show it to you right now.
The alert is in the second and third lines of the code and writes everything in the log, including the fact thatOrderClosePrice( ) of order 49 is equal to zero.When I place an order, I save the time in the wremjapomnim window. As soon as any order is closed at currentprofit, I delete all orders and again remember the time in the wremjapomnim pyrimen and set them.
Tell me how to track the formation of a fractal in the EA. I need to open an order after the formation of a new fractal. I do not know how this indicator works; it has some kind of upper line and some kind of lower line.
If, for example, a fractal is formed and the price breaks that minimum, will the fractal be re-drawn or will I just add another fractal?