[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 385
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?