[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 98
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
Kim has a function:
I have two questions:
1. Why does it translate the time to a string at once and then the string to a time?
2. Why this condition in the function?
Because checking the time below... Right here:
And in function parameters, time variables are not of datetime type, but int for some reason...
Kim has a function:
I have two questions:
1. Why does it translate the time to a string at once and then the string to a time?
2. Why this condition in the function?
Because checking the time below... Right here:
And in function parameters, time variables are not of datetime type, but int for some reason...
1. To replace the current hour and minute values in the time with the values specified in the function parameters
I would do it like this:
2. To additionally correct start or end dates by day
datetime and int are essentially the same thing, and the parameters are not full dates, but only the number of hours and minutes
2. For additional correction of start or end dates by day
Why? We need to limit the trading time of the EA. And we are not interested in the time from the hour when the trading time ends to the hour when the trading time starts, because the EA does not trade at that time! I don't understand what NONSENSES are...
The datetime and int are essentially the same thing, and the parameters are not the full dates, but only the number of hours and minutes
But time must be time, how can there be no difference?Time is a number, and a whole number at that.
Time is a number, and it's an integer.
I understand what I mean with time - it's not a date, that's why it is declared as a number. But what about:
As many variants as I've seen, I've never seen anything like this... It is somehow strange. Moreover, there is no cycle here, and minus and plus the time of the beginning and the end of trade. I do not understand this point.
In fact, we got the start and end times of db and de trade above. So, this piece may be erased, and then we will check the time:
What is the point of writing extra code? Please explain this point. It's actually not logical.
If we don't use minutes, we may simplify it. I understand what we mean with time - it's not date, we declare date. What about:
As many variants as I've seen, I've never seen anything like this... It's strange somehow. Moreover, there is no cycle here, and minus and plus the time of the beginning and the end of trade. I do not understand this point.
In fact, we got the start and end times of db and de trade above. So, this piece may be erased, and then we will check the time:
What is the point of writing extra code? Please explain this point. It's not really logical.
Everyone is free to do his own thing. Igor did it this way. I do it differently.
And whether you get a plus or minus. So, it depends on the time of trading. For example, how to arrange trading from 21 hours to 5 hours.
If the minutes were not used, everything would be much simpler.
Everyone is free to do it his own way. Igor did it this way. I am doing things differently.
And whether it's plus or minus. So it depends on the time of trading. For example, how to organise trading between 9 p.m. and 5 a.m.
And the code is redundant. It does not matter.
If the minutes were not used, everything would be much simpler.
Make the trading time be from 21.00 to 23.59, and then from 00.01 to 5.00
Are there any other options?
Make the trading hours 21.00 to 23.59 and then 00.01 to 5.00
Are there other options?
If you write if(Hour() >= 21 || Hour() < 5) it will be from 21.00 to 4.59.
That's weird. It skips past midnight and doesn't take that into account at all?