Now we have three input variables. This is the one that should be changed when starting the second and the next indicator copies. But it is not used anywhere in the code.
How can you not understand? Here is the indicator from the MT delivery
There are two input variables highlighted. We just need to add a worthless input variable
Now we have three input variables. This is the one that should be changed when starting the second and the next indicator copies. But it is not used anywhere in the code.
That's how I understood it. I was asking how to do it without hands, automatically. I understand that the documentation says that only the user can change the intu. But it is not necessary to do something with the intut. The question is how to set 2 indicators with the same input parameters. It's also written in the documentation that when removed from a chart, the indicator is identified by its SHORTNAME plus the input parameters (I think, it may be the same during initialization). If the input parameters are the same, I tried to change the SHORTNAME (adding to it each time the number of indicators in the chart). It does not help. But it works somehow in mt4? And I don't change parameters and short-name. So I'm asking who knows how it works?
Aleksandr Kononov #: That's how I understood it. I was asking about how to do it without hands, automatically. I understand that in documentation it's written that only user can change the incut. But it is not necessary to do something with an intuition. The question is how to apply 2 indicators with the same input parameters. It's also written in the documentation that when removed from a chart, the indicator is identified by its SHORTNAME plus the input parameters (I think, it may be the same during initialization). If the input parameters are the same, I tried to change the SHORTNAME (adding to it each time the number of indicators in the chart). It does not help. But it works somehow in mt4? And I don't change parameters and short-name. So I'm asking who knows how it works?
Can you then explain why this is necessary? After all, the reason for banning such hand-me-downs is obvious, but your desire is unclear. Just for the sake of interest and I wasted my time explaining all this to you, or is there some justified need?
Can you then explain why this is necessary? After all, the reason for banning such hand-me-downs is obvious, but your desire is unclear. Just for the sake of interest and have I wasted my time explaining all this to you, or is there some justified need?
Can you explain what is the reason for the ban? Because of my inexperience, I don't understand what is so terrible about it. I need it to write an indicator for sale.
Aleksandr Kononov #: Can you explain the reason for this ban? Inexperience, I do not understand what is so terrible about it. And I need it to write an indicator for sale.
All indicators work in the same thread. Accordingly, each indicator consumes some CPU resources. Put 100500 indicators with the same parameters and what will happen to the terminal? If 300 grams of potatoes are enough to make you happy in the next 20 minutes, but you will have a sack full of them on your shoulders. How do you like it?
All indicators work in the same thread. Accordingly, each indicator consumes some CPU resources. Put 100500 indicators with the same parameters and what will happen to the terminal? If 300 grams of potatoes are enough to make you happy in the next 20 minutes, but you will have a sack full of them on your shoulders. How do you like it?
Good afternoon. I've read about vail. I can't add or subtract. I can't say anything about money management, I haven't tried it. I have attached the latest version. But I have already messed everything up for myself) Order1(2) the selected order's profit Order1(3) the selected order's lot
I could not understand the code.
I will try to explain. I hope you know the tickets of needed orders, it makes things very easy. The conditions. There is a profit order with a profit greater than zero, there is a loss order with a profit less than zero and greater than the profit profit, and there is a condition for partial closing of a loss order.
In general, if orders are differently directed, you can close through OrderCloseBy without thinking twice. The smaller loss order will be closed equal to the smaller profit order. We only need 2 tickets.
We can make it more complicated, get OrderProfit() (this is money) and OrderLots() (this is the volume in lots) of both orders. Calculate the ratio of profit to loss and close the profitable order and this part in lots of the losing order. Before obtaining the profits and lots of the order, you must first select the OrderSelect.
// ticket1 тикет прибыльного ордера, ticket2 убыточногоbool sel1=OrderSelect(ticket1,SELECT_BY_TICKET,MODE_TRADES);
double profit1=OrderProfit();
double Lts1=OrderLots();
double price1=0; if(OrderType()==0)price1=Bid; else price1=Ask;
bool sel2=OrderSelect(ticket2,SELECT_BY_TICKET,MODE_TRADES);
double profit2=OrderProfit(); // profit1 < profit2 можно условием впереди поставитьdouble Lts2=OrderLots();
double price2=0; if(OrderType()==0)price2=Bid; else price2=Ask;
double ratio=fabs(profit1/profit2); // или если ratio<1, и берем модуль, у нас один профит меньше нуляdouble lotsl=Lts2*ratio;
Alert("Попытка закрыть прибыльный ордер тикет1 ",ticket1,". Ожидание ответа..");
RefreshRates(); // Обновление данныхbool Ans1=OrderClose(ticket1,Lts1,price1,2); // Закрытие прибыльного ордераif(Ans1==true) // Получилось :)Alert("Закрыт ордер тикет1 ",ticket1,". профит1 ",profit1);
elseAlert(" Ошибка при закрытии ордера тикет1",ticket1," Код ошибки ",GetLastError());
Alert("Попытка закрыть часть ордера тикет2 ",ticket2,". Ожидание ответа..");
RefreshRates(); // Обновление данныхbool Ans2=OrderClose(ticket2,lotsl,price2,2); // Закрытие убыточного ордера частичноif(Ans2==true) // Получилось :)Alert("Закрыт частично ордер тикет2 ",ticket2,". профит2 ",profit2);
elseAlert(" Ошибка при закрытии ордера тикет2",ticket2," Код ошибки ",GetLastError());
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.
Not really, I told you how to get around this logical limitation.
Ok, then maybe you can use define to substitute a value into an intu? I tried that too, but it didn't work.
OK, then maybe you can use a define to substitute a value into the intu? I tried that too, but it didn't work.
How can you not understand? Here is an indicator from MT delivery
There are two variables highlighted. We just need to add a useless input variable
Now we have three input variables. This is the one that should be changed when starting the second and the next indicator copies. But it is not used anywhere in the code.
How can you not understand? Here is the indicator from the MT delivery
There are two input variables highlighted. We just need to add a worthless input variable
Now we have three input variables. This is the one that should be changed when starting the second and the next indicator copies. But it is not used anywhere in the code.
That's how I understood it. I was asking about how to do it without hands, automatically. I understand that in documentation it's written that only user can change the incut. But it is not necessary to do something with an intuition. The question is how to apply 2 indicators with the same input parameters. It's also written in the documentation that when removed from a chart, the indicator is identified by its SHORTNAME plus the input parameters (I think, it may be the same during initialization). If the input parameters are the same, I tried to change the SHORTNAME (adding to it each time the number of indicators in the chart). It does not help. But it works somehow in mt4? And I don't change parameters and short-name. So I'm asking who knows how it works?
Can you then explain why this is necessary? After all, the reason for banning such hand-me-downs is obvious, but your desire is unclear. Just for the sake of interest and I wasted my time explaining all this to you, or is there some justified need?
Can you then explain why this is necessary? After all, the reason for banning such hand-me-downs is obvious, but your desire is unclear. Just for the sake of interest and have I wasted my time explaining all this to you, or is there some justified need?
Can you explain the reason for this ban? Inexperience, I do not understand what is so terrible about it. And I need it to write an indicator for sale.
All indicators work in the same thread. Accordingly, each indicator consumes some CPU resources. Put 100500 indicators with the same parameters and what will happen to the terminal? If 300 grams of potatoes are enough to make you happy in the next 20 minutes, but you will have a sack full of them on your shoulders. How do you like it?
All indicators work in the same thread. Accordingly, each indicator consumes some CPU resources. Put 100500 indicators with the same parameters and what will happen to the terminal? If 300 grams of potatoes are enough to make you happy in the next 20 minutes, but you will have a sack full of them on your shoulders. How do you like it?
Can you tell me if I've seen an indicator subwindow drawn in this style somewhere in kodobase?
Can't find it
Good afternoon. I've read about vail. I can't add or subtract.
I can't say anything about money management, I haven't tried it.
I have attached the latest version. But I have already messed everything up for myself)
Order1(2) the selected order's profit
Order1(3) the selected order's lot
I could not understand the code.
I will try to explain. I hope you know the tickets of needed orders, it makes things very easy. The conditions. There is a profit order with a profit greater than zero, there is a loss order with a profit less than zero and greater than the profit profit, and there is a condition for partial closing of a loss order.
In general, if orders are differently directed, you can close through OrderCloseBy without thinking twice. The smaller loss order will be closed equal to the smaller profit order. We only need 2 tickets.
We can make it more complicated, get OrderProfit() (this is money) and OrderLots() (this is the volume in lots) of both orders. Calculate the ratio of profit to loss and close the profitable order and this part in lots of the losing order. Before obtaining the profits and lots of the order, you must first select the OrderSelect.
Can you tell me if I've seen an indicator subwindow drawn in this style somewhere in kodobase?
Can't find it.
See indicators by Scriptor