Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 979
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
Hi, I need some advice. Why is my last text not showing? What's wrong here? Can you please tell me how to fix it!
Why do you need a loop if you only take the name of one object at all times?
Iurii Tokman:
You can't exactly do this - it will be out of the array's bounds. If there are 10 objects, the index of the last one will be 9. Because it counts from zero.
Why a loop if you only take the name of one object at a time?
tell me exactly how to determine the penultimate text of this object.
tell me exactly how to determine the penultimate text of this object.
It's hard to know what you want.
Provit - shows total profits during the test during the day
Provit1 - shows maximum drawdown for the day
Provit2 - normal numeric row starting from one
Provit3 - Target! Sum up Provit1 and divide by Provit2. I want to know the average daily drawdown for the total time of the test. Help to understand Provit3
Colleagues - what could this close error be and how to deal with it? Here is the code below, when the profit is exceeded - close all unidirectional positions. Thank you.
Colleagues - what can this be a closing error and how to deal with it? If i want to use the code below, i need to close all of the one-directional positions if they are profitable. Thank you.
What's the error? wrong screen
in theory it should work, but I haven't seen such a sophisticated closing taking into account the spread and adding it as slippage - imho, if you decide to close, then slippage is not the most important thing to watch for, closing errors are more important, then requotes, then the connection is lost completely
Take OrderClose(....) away and replace it with Kim's ClosePosBySelect()https://www.mql5.com/ru/forum/131859/page2#comment_3359664
use it, then you will clearly see where it is breaking - either in your closing conditions or the server has a bug
What's the error? wrong screen
in theory it should work, but I haven't seen such a sophisticated closing taking into account the spread and adding it as slippage - imho, if you decide to close, then slippage is not the most important thing to watch out for, closing errors are more important, then requotes, then the connection is lost completely
remove OrderClose(....) and pass the ticket to Kim's ClosePosBySelect() instead, then it will become clear where it does not work - either in your closing conditions or the server has a bug
He has a zero price close there. Accordingly, we need to control what was returned by MarketInfo-function, but there is no control. However, as usual on four, some people are used to write - something received, what - did not check, but sent an argument.
He has a zero price close there. Accordingly, we need to control what was returned by MarketInfo-function, but there is no control. However, as usual on the four some people are used to write - something received, what - did not check, but sent the argument.
I have seen it, I doubt that he will be able to unset everything himself, that's why I suggested to use checked ClosePosBySelect() to close selected order viaOrderSelect( ) - he can do that, at least I have seen him assembling codes with constructor )))
SZY: I have another suspicion that it closes one order twice, but the Kim's function prints into the log, it seems there are no separate loops to close by the 2nd condition
I've seen it, I doubt it will be able to unprime everything on its own, that's why I suggested using the proven closing of a highlighted order via OrderSelect()
Sure, Igor's functions will do everything for the user (and even some users manage to make a mistake with them). But in this case, he will never learn to do anything himself. Although, of course - their choice.