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
Thanks for that example.
I thought I was the only one who preferred laying things out that way, rather than writing dickishly.
hz - translated into Russian as "I'd like to know"... don't think badly...It's better to use classes from the standard library so you don't have to write all those long PositionGet... etc.
Thanks for that example.
I thought I was the only one who preferred to lay things out that way instead of writing it in a dumbed-down way.
What's the problem?
Don't take this asa "coder nazi", but I, for one, find such constructions disturbing:
It's a nuisance to the eye. Wouldn't it be better to make it not"zaz how", but like this:
Or this kind of "shithcoddling":
WherePositionsTotal()is called at each loop iteration!
A normal coder would never manipulate the body of the loop that goes through the positions by their index (which, thank God, is absent here) leading to a change of their number. This is just the height of illiteracy and glitchy code. You have to restart the whole loop if you're supposed to do something like this.
Also some people like something like this:
Although, to a beginner and not concerned with extra hours of CPU time for optimization, such "if-then-otherwise-all" constructions from school lessons of "programming" in BASIC, are clearer.
And all this isreplicated from code to code by the principle of copy-paste.
So there you go...
...
Or this kind of "shithcoding":
WherePositionsTotal()is called per loop iteration!
...
Are you sure? You wanted to be clever, but you're in a rut...
And you registered for that purpose? Just like that - from the first post and get lost...
Are you sure? You were trying to be clever, but you've gone rogue...
And you registered for this on purpose? Just like that, from the first post, you're in the toilet...
Oh, dear. "Learn the math," Elger and Knut. Don't get personal.
All right, I'll explain:
Is that clear, dear?
If not, thoughtfully read https://learnc.info/c/loop.html starting somewhere from [ctrl+f , look for "Cycle for"].
Here's not even lazy to find the link.
And learn to write literate, nice, concise code. You should have started with assembler, with microcontrollers where every byte counts.
P.S.
Here I was even too lazy to show the expert a simple example of his loop "for".
And this is the result of the sample run:
You can see that the function is not only called at each iteration, but even +1 time in the end.
So there you go.
Eh, darling. "Learn your maths," Elger and Knut. Don't get personal.
All right, I'll explain:
Is that clear, dearie?
If not, thoughtfully read https://learnc.info/c/loop.html starting somewhere from [ctrl+f , look for "Cycle for"].
Here's not even lazy to find the link.
And learn to write literate, nice, concise code. You should have started with assembler, with microcontrollers where every byte counts.
P.S.
Here I was even too lazy to show the expert a simple example of his loop "for".
And this is the result of the sample run:
You can see that the function is not only called at each iteration, but even +1 time in the end.
So there you go.
I applaud! Carry on...
I applaud! Carry on...
Are you sure? You were trying to be clever, but you've gone rogue...
And you registered for this on purpose? Just like that - from the first post and into a puddle...
Whatan interesting conversation you're having) ))
Gentlemen, personalities are personalities, but let's find out the truth.
Using the example, I can see thatPositionsTotal()is called at each loop iteration.
But Dimitri, on the contrary, you are saying that the compiler does it in a different way - I don't understand it. Explain.
If you want to say that thePositionsTotal() function does not recalculate positions each time, but simply returns the value of a variable containing the number of open positions, then yes, you are right, there is no sense in declaring one more variable, but then what does the compiler have to do with it?
And if this function recalculates open positions every time, then it turns out that the compiler has to understand if the value of this function affects further calculations and uses either a function or a variable.
Something doesn't add up for me.
Interesting conversation you are having)))