If you use the standard object creation function, the default setting is selection = true. For example, for the trend line, the 4th line from the bottom:
This function enables/disables selection, but does not select the object itself
jarikn: I wrote an EA and it seems to be working. But the thing is that by crossing the sliders, the orders should be closed. To be more precise, only the first order is closed, and it doesn't matter which way it went, after that, the order log generates error OrderClose error 4051. What is the problem?
try this function
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 19.02.2008 |//| Описание : Закрытие позиций по рыночной цене |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента ("" - любой символ, |//| NULL - текущий символ) |//| op - операция (-1 - любая позиция) |//| mn - MagicNumber (-1 - любой магик) |//+----------------------------------------------------------------------------+void ClosePositions(string sy="", int op=-1, int mn=-1) {
int i, k=OrdersTotal();
if (sy=="0") sy=Symbol();
for (i=k-1; i>=0; i--) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (mn<0 || OrderMagicNumber()==mn) ClosePosBySelect();
}
}
}
}
}
jarikn: I have written an EA and everything seems to be working. But the issue is that orders have to be closed once the sliders cross. To be more precise, only the first order is being closed, and it doesn't matter which way it goes. After that, the order log generates the error OrderClose error 4051. What is the problem?
Young man, if you even have an error number, what's the problem with looking it up by number? Do you want me to do it for you?
And for the forum to make sense, first try to identify the problem yourself, try to deal with it, and only then go to the forum with an accurate description of the problem. Not "it's not working for me, what's the problem?".
The question was "What do you have?" in the context of "The indicator, if properly made, always calculates the whole story first".
Correspondingly, the question means: "What does the indicator do on the first launch? Does it calculate the history? Or does it not calculate the history? It's a standard Bollinger, isn't it?"
The question was "What have you got?" in the context of "The indicator, if properly made, always calculates the whole story first".
Correspondingly, the question means: "What does the indicator do on the first launch? Does it calculate the history? Or does it not calculate the history? It is a standard Bollinger, isn't it?"
For a certain time frame, the EA calculates the candles andthe Bollinger, and creates objects at the intersections. (very simplified, but the essence is the same)
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.
OBJPROP_SELECTED
Object selection
mql5
mql4
This function enables/disables object selection, but does not select the object itself
If you use the standard object creation function, the default setting is selection = true. For example, for the trend line, the 4th line from the bottom:
This function enables/disables the selection of an object, but does not select it.
No!
OBJPROP_SELECTED highlights the object, but
OBJPROP_SELECTABLE enables/disables the selection
This function enables/disables the selection of the object, but does not select it
enables/disables the selection of this property:
OBJPROP_SELECTABLE
Object availability
I wrote an EA and it seems to be working. But the thing is that by crossing the sliders, the orders should be closed. To be more precise, only the first order is closed, and it doesn't matter which way it went, after that, the order log generates error OrderClose error 4051. What is the problem?
try this function
Hello, can I register a signal in MQL5 from my demo account? I have already registered it on my demo account. Thank you.
Yes, it is possible. But you can't sell it. It will be free, it can be copied from demo to demo.
I have written an EA and everything seems to be working. But the issue is that orders have to be closed once the sliders cross. To be more precise, only the first order is being closed, and it doesn't matter which way it goes. After that, the order log generates the error OrderClose error 4051. What is the problem?
Young man, if you even have an error number, what's the problem with looking it up by number? Do you want me to do it for you?
And for the forum to make sense, first try to identify the problem yourself, try to deal with it, and only then go to the forum with an accurate description of the problem. Not "it's not working for me, what's the problem?".
I don't understand the question
The question was "What do you have?" in the context of "The indicator, if properly made, always calculates the whole story first".
Correspondingly, the question means: "What does the indicator do on the first launch? Does it calculate the history? Or does it not calculate the history? It's a standard Bollinger, isn't it?"
The question was "What have you got?" in the context of "The indicator, if properly made, always calculates the whole story first".
Correspondingly, the question means: "What does the indicator do on the first launch? Does it calculate the history? Or does it not calculate the history? It is a standard Bollinger, isn't it?"
For a certain time frame, the EA calculates the candles andthe Bollinger, and creates objects at the intersections. (very simplified, but the essence is the same)