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 join the question -- what sucks about the code in the first post?
About OOP. There's not just a lot of material, there's a ton of it. Just not on this site. And even here there is some. Some people are just too lazy to do a proper search and study.
At least, it works only on the symbol on which the Expert Advisor is installed....
No, the code is quite good. It's just that you want something from it that it's not designed for.
And that will be the biggest problem with your proposal in general.
Many things can be written effectively in many ways. Different people evaluate both the task and the solution, and the criteria for its effectiveness, in different ways.
For example, in MT it is more important for me to have simple code than to be able to assemble it from universal bricks.
Don't worry. It's not my craft.
If I ask you to show me an example of code writing, say "How much time is left until the end of the timeframe?" You're 100% guaranteed to send meto the fuck off
or to the work department. That's just for setting an example!
That's what fear and reluctance is all about. But the fingers are always outstretched.
You may also say that most of those asking to show the code are just lazy, and they are too lazy to look through the code base to find the code "How much time is left till the end of the timeframe?
It is not interesting to reveal oneself to the lazy)
Владимир:
VOLDEMAR is right. Programmers are all different.
Artyom Trishkin 2015.05.31 11:27
I choose Artyom Trishkin.
I agree, it would be amazing if everyone was the same...
And I respect Artyom(artmedia70), but in this case I can't choose him... And code brevity, is not yet a panacea.
Concise code can be insecure and potentially dangerous...
iTime
Returns the value of bar open time (specified by shift parameter) of corresponding chart.
Parameters
symbol
[Symbol name of symbol. NULL means current symbol.
timeframe
[in] Period. Can be one of values of enumeration ENUM_TIMEFRAMES. 0 means period of current chart.
shift
[in] Index of the timeframe value (shift relative to the current bar by the specified number of bars back).
Returned value
Value of the bar open time (specified by the shift parameter) of the corresponding chart or 0 in case of an error. You need to call GetLastError() to get more information about the error.
Forum for trading, automated trading systems and strategy testing
Introductions to administration and locals
Vladimir Pastushak, 2015.05.31 08:20
The question for you is which code do you think is more correct ???
1
2
3
-- haven't tested each option for correctness -- but assuming that all three options are identical according to the results -- then any option is correct
-- about code concision -- which option is easiest and fastest to edit? -- which variant, after time, is easier and quicker to deal with logically and without further explanation?
I choose
That's why programmers use a fan of their fingers :) You really have nothing to choose from and you haven't understood it. In my file there is an example of implementation with per-second display of remaining time on the chart. And this function will update timer only at next tick receipt, when TimeCurrent() is updated + its output has to be somehow realized, i.e. we should overfit it with some brief code. In my example, all stuffing with precision optics is already there, and TimeCurrent() is used purely for synchronization with the server :)
Why, are you tripping over a 'fan' of my fingers?
I showed you how to know how much time is left before the next candle opens in any timeframe. That's all. The question was exactly the same.