artmedia70: I added one more condition to the loop and removed unnecessary parentheses. In general, everything may be done in a different way (it will be even better). Maybe a person initializes his or her variable each time after the loop, we cannot see it anymore. Let's learn from telepaths...
Thanks a lot for the tips ! The reason was inattention after all... :-)))
In case of failure I should have passed the variable the opposite value...
Please help .... there are 5 buy orders at different distances of 30-150pp from each other, price is far to the top how to make the advisor to transfer all stop losses to the top order to breakeven ????????
VOLDEMAR: Please help .... there are 5 buy orders at different distances of 30-150pp from each other, price is far to the top how to make the advisor to transfer all stop losses to the top order to breakeven ????????
Good morning!!! On silver it often happens that when trying to place a position it asks 20 times to the minute do you want new prices? How to avoid it?
Hello all! Here's pulling out the names of the objects.
We have a name, for example: _0Triangle_0.... followed by a variable part.
How would I get just the word Triangle out of this text? Task: compare it to the same one to make sure there is such an object. Or rather, that there is an object whose name part is Triangle
int obj_total=ObjectsTotal();
string name;
for(int i=0;i<obj_total;i++) {
name = ObjectName(i);
Print(i," - объект ",name);
}
Hello all! Here's pulling out the names of the objects.
We have a name, for example: _0Triangle_0.... followed by a variable part.
How would I get just the word Triangle out of this text? Task: compare it to the same one to make sure there is such an object. Or rather, that there is an object whose name part is Triangle
string sMask="Triangle";
int obj_total=ObjectsTotal();
string name;
for(int i=0;i<obj_total;i++) {
name = ObjectName(i);
if ( StringFind(name, sMask) >=0) {
Print(i," - объект ",name);
}
}
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.
I added one more condition to the loop and removed unnecessary parentheses. In general, everything may be done in a different way (it will be even better). Maybe a person initializes his or her variable each time after the loop, we cannot see it anymore. Let's learn from telepaths...
Thanks a lot for the tips ! The reason was inattention after all... :-)))
In case of failure I should have passed the variable the opposite value...
I.e., not
if (OrderProfit() > 0) kickup = 2;
а
if (OrderProfit() > 0) { kickup = 2; } else { kickup = 1; }
Can you please tell me what is wrong in the code? The robot should close the sell order and if it is missing, it should buy, i.e. open a buy order.
for(cnt=OrdersTotal();cnt>=0;cnt--){
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); mode = OrderType();
if(OrderSymbol() == Symbol()){
if(mode == OP_SELL) result=OrderClose(OrderTicket(), Lots, Ask, slippage, Blue);} // if open, close
else{result=OrderSend(Symbol(),OP_BUY,Lots,Ask,2*Point,0,0, "robot is buying",MagicNumber,0,White); return;}}
Please help .... there are 5 buy orders at different distances of 30-150pp from each other, price is far to the top how to make the advisor to transfer all stop losses to the top order to breakeven ????????
Hello all! Here's pulling out the names of the objects.
We have a name, for example: _0Triangle_0.... followed by a variable part.
How would I get just the word Triangle out of this text? Task: compare it to the same one to make sure there is such an object. Or rather, that there is an object whose name part is Triangle
How would you get just the word Triangle out of this text?
StringSubstr
Thank you
Hello all! Here's pulling out the names of the objects.
We have a name, for example: _0Triangle_0.... followed by a variable part.
How would I get just the word Triangle out of this text? Task: compare it to the same one to make sure there is such an object. Or rather, that there is an object whose name part is Triangle
How do you get the full name from an object number?