
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
The question for you is which code do you think is more correct ???
In my opinion, definitely the first one. As it is more transparent, more understandable, and easier to maintain.
Personally, I would only write the first variant, and moreover, if possible, corrected both subsequent variants to the first one.
Why, are you tripping over a 'fan' of my fingers?
This is what fear and reluctance are all about. But the fingers are always spread out.
At least it works only on the symbol on which the Expert Advisor is installed....
What do you mean? There's a comparison that sifts out all other characters !
I thought wrong code is a code that either performs erroneous actions, or contains potential errors. Here, of the three codes listed below - I would definitely choose the first one just because the second and third are difficult to understand, in them it is much easier to make and then find the error, and if they can not be replaced - there should be a whole page of comments, what formula is used, and why it is exactly the same.
For me, for example, having simple code is more important in MT than being able to assemble it from generic bricks.
And here I would argue.
Copying simple code via Copy-Paste, in my opinion, is more dangerous than using a class which implements common functionality, although it makes the code a bit more complicated.
I think you have to decide for each situation - sometimes it's more reasonable to copy simple code and at other times it's more reasonable to call a generic class.
And here I would argue.
Copying simple code via Copy-Paste, in my opinion, is more dangerous than using a class in which common functionality is implemented, although this makes the code a bit more complicated.
I think you have to decide by situation - sometimes it's more reasonable to copy simple code, sometimes it's more reasonable to call a generic class.
Actually here is a simple and clear code, while the previous three samples are not very good
In fact, here is simple and straightforward code, and the previous three examples not so much
there's a saying: "if you think clearly, you write clearly", so with "simple and straightforward code".
Plain is when it's clear.
Simple is when it's simple.
There's a saying: "He who thinks clearly, speaks clearly", and so it is with "plain and simple code".
clear is when it's clear.
Simple is when it's simple.
And in short code there's less room for mistakes. :)
In fact, here's simple and straightforward code, and the previous three examples not so much
Yes, that's right. There was no such code in the selection, though - so you changed the conditions on the fly.
But this code is good when we have a clear dependence in the form of a formula. This rarely happens. More often - there are certain ranges for different variants, which are identified by genetic optimization - and then the first variant is much more correct than trying to "fit the formula" to the found boundaries.
Thus - in order to evaluate the code you need to know the situation fully.
Yes, that's right. There was no such code in the selection, though - so you changed the conditions as you went along.
But this code is good when we have a clear dependency in the form of a formula. This rarely happens. More often - there are certain ranges for different variants, which are identified by genetic optimization - and then the first variant is much more correct than trying to "fit the formula" to the found boundaries.
So, to evaluate the code you need to be fully aware of the situation.
I didn't adjust the code, I purposely did not specify it, if you read the correspondence in the article you will see this code there... I just wanted to know if someone would offer a better code...
You need to know the situation anyway...
...
index_rsi = (int)((rsi-50.0)/10.000001);