
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
Exactly. And the smaller the code, the easier it is to understand. I can't stand fonts "smeared" on 2-3 screens. A function should be all on the screen, without flipping. That's why I'm in favour of compactness.
I can't stand them either :) . My function fits in the screen.
And is it OK that you have a lot of optional continuums which, incidentally, again draw the reader's attention away from you?
Well, reducing function complexity is one of basic conditions for writing GOOD code.
If you like it this way, you have 2 options :
1. You are accustomed to a bad code style and you use it yourself, nothing good can come of it, when you will have to write a really fundamental code you will understand my rightness. At least when you switch to MQL5.
2 And I think this is just about you - you use this code, because you are unable to write your own code properly, as a programmer you are not anything and then you have no right to judge and discuss my post to the author of this thread. All the more I was addressing to the author.
I apologise for my post to the author, I wrote in vain, as I won't be using this code anyway, as I have my own libc with everything I need. And because for such a long time there was no clearly negative feedback, it means that the author's code satisfies. Just couldn't stand it :), sorry.
I apologise for my post to the author, I wrote in vain, as I won't be using this code anyway, as I have my own libc with everything I need. And because for such a long time there was no unequivocally negative feedback, it means that the author's code satisfies. Just could not stand it :), sorry.
I apologize for writing, but I couldn't stand it. You will be in vain if you leave the branch because of one's opinion. Especially the author said thank you.
I think it would be nice if one and the same task can be solved by 2 (or more) codes. You can share your codes solving the same task if you think they are better.
Often, seeing how someone else has coded the same thing, but in a different style. You can learn a lot.
P.S. Igor, thank you for your work.
The ArraySearchDouble() function.
This function searches for an array element using a value of double type and returns the index of the found element or -1. The function finds only one element and stops the search if the result is positive.
The ArraySearchInt() function.
This function searches for an array element by an int type value and returns the index of the found element or -1. The function finds only one element and stops the search if the result is positive.
The ArraySearchString() function.
This function searches an array element for a value of string type and returns the index of the found element or -1. The function finds only one element and stops the search if the result is positive.
Indeed, Andrey, you should not have taken it that way. >> Be simple! And don't be afraid to push me down. I won't mind if you'll make a contribution and correct something of mine or post your own.
OK, I have a slightly different view on things, as I've already written, I consider global universality to be an evil, i.e. the code should be at least a little bit customised for what you are writing, in order to achieve maximum simplicity and convenience. That's why I don't see any sense in publishing my own code here.
I can act as a reviewer of your code, if you don't mind of course, and offer your own version of it or just give comments.
SZZH: Thank you for your support, to be honest I didn't expect that kind of feedback from you.
The ArraySearchDouble() function.
This function searches for an array element using a value of double type and returns the index of the found element or -1. The function finds only one element and stops the search if the result is positive.
Double is a tricky thing, and your code may work incorrectly in some situations.
Here's a possible workaround
And if you want to do the same thing but from the end.
I can act as a reviewer of your code, if you don't mind, of course, and offer my own version of it or just give comments.
I was writing an EA the other day, in which I needed to change the lot size depending on the result of a previous trade and the lot size of the same trade. And it turned out that I didn't have a function that would return the lot size of the last closed position. Here's a correction...
The GetLotLastClosePos() function.
This function returns the lot size of the last closed position, or -1. The selection of positions to be taken into account is defined by external parameters: