[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 594

 
rigonich:
Hour() Returns server start time of the program. Terminal clock for the specified time (server clock to be exact) without any seconds is returned byTimeHour() function.


nota....

Hour() change takes a long time to check...you have to wait 20 minutes...

So I checked Minute ()...

Print ("time===",Minute(); shows the minute change - every minute.

So the clock changes too... i.e. it actually shows the current time.

Now a question...

why in my line

if ( Ma_1>Ma_2 && (OrdersTotal()==0) && (Hour()>=7 || Hour()<19))

in the tester, trades are spooled in all 24 hours WITHOUT any limitations?

 
lottamer:


nota....

Hour() change takes a long time to check...you have to wait 20 minutes...

so I checked Minute ()...

Print ("time===",Minute()); shows the minute change - every minute.

So the clock changes too... i.e. it actually shows the current time.

Now a question...

why in my line

if ( Ma_1>Ma_2 && (OrdersTotal()==0) && (Hour()>=7 || Hour()<19))

in the tester, trades are spooled in all 24 hours WITHOUT any limitations?

What did you check it with? If it's a script, then every time you call it, it starts again and will show a different time, in the tester this time is simulated. So owls and the script will show different results.

Try to run your EA with the same condition on the demo before 7 and after 19 and I don't think it will open anything at all.

 
rigonich:
How did you check it? If it's a script, then every time you call it, it will start again and show different times, in the tester these times are simulated. So owls and script will show different results.


I wrote a mini-advisor - which only outputs the time via Print.

put it up and watched the result....

 

Yes. I thought it was probably not very accurate to compare exactly like that - which is what I wrote straight away.

if (tsena==Ask)

But it could be that the price will simply jump to that value! And it won't hit it exactly like that.

 
lottamer:


I wrote a mini-advisor - which only does time output via Print.

put it up and watched the result....


If so, then that's a question for the help developers.
 
Dimka-novitsek:

Yes. I thought it was probably not very accurate to compare exactly like that - which is what I wrote straight away.

But it could be that the price will simply jump to that value! And it won't hit it exactly like that.

Useif (tsena>=Ask)
 
rigonich:

If so, then that's a question for the developers of the help.

RIGHT! - everyone can make a mistake:

if(Hour()>=12 || && Hour()<17)

BUT, nature gave us a brain for such cases!!! And I would write it down this way for safety's sake:

if (TimeHour (TimeCurrent()) >= 12 && TimeHour (TimeCurrent()) < 17)

And there are even examples of functions to control the time of the EA!

 
TarasBY:

RIGHT! - everyone can make a mistake:

BUT, nature gave us a brain for such cases!!! And I would write it down this way for safety's sake:

And there are even examples of functions to manage the EA's running time!


I've been browsing different links and forum threads and I'm getting greedy.I'm a new user of this forum, less than a month. Now I look -- a lot of things I've spent a lot of time and effort on are already here and a lot of them are better than mine. It's just a pity for the time and effort. Although, otherwise, I would probably not have understood or appreciated much.

Thanks for the link. I don't know much about the forum yet, it's too much stuff, not enough time.

 
rigonich:


I've been browsing the various links and forum threads and I'm getting greedy. I joined the forum not so long ago, less than a month. Before thatI was steaming in "my own sake" like a Japanese. Now I look -- a lot of things I've spent a lot of time and effort on are already here and a lot of them are better than mine. It's just a pity for the time and effort. Although, otherwise, I would probably not have understood or appreciated much.

Thanks for the link. I don't really know my way around the forum yet, it's too much stuff, not enough time.

Remember the motto of the Spartakiade: "Do as we do, do as we do, do better than we do! Not everyone was offered such a thing! Training! - The road to success! You weren't "boiled" for nothing! ;)

P.S. I remembered the Spartakiade as a motive (competitive spirit) for moving towards success. ;)
 
in mt4 can you see charts before 1991 ? ?
Reason: