function sleep alternative - page 3

 
RaptorUK:
Sure,  it's not very elegant so I wouldn't suggest anyone use it.  I used a GlobalVariable set and unset by a script,  when the EA in the ST saw the GlobalVariable was set it would sit in a loop continually checking for the GlobalVariable to be unset,  when the script had unset the GlobalVariable the EA exited the loop and it's start() function could terminate.

Simon,

Will this method consistently track seconds within the strategy tester?

If it does, please explain in more detail.

If it doesn't, please state so.


Thank you kindly for an explanation of your meaning.

Thank you

 
RaptorUK:
Lets assume you have 2 events and these events are 10 seconds apart,  what will be the difference between the values returned by  TimeSeconds(datetime time)  for these 2 events ?

Simon,

This should depend on the format and intended use of TimeSeconds(datetime time) with the determined datetime time used.


All due respect, I believe your statement to be too general to answer correctly. "Lets assume you have 2 events and these events are 10 seconds apart,..." What event in particular? Tick creations?

Ok, lets assume tick creations are what you do mean. Also, I'm assuming by datetime time you mean TimeCurrent(). Again, if this is also your meaning, if there are no ticks for ten seconds and then a tick is then created, the seconds of time "gap" is ten and a tick is created either on the tenth second or the eleventh. I believe I understand what you are trying to relate.

I believe I could simply track the second whenever a tick is formed and keep up with seconds in this manner. Whew, ;) Hahaha! Wow.


Thank you

 

I know that it is possible to make function that detects the different prices in xx seconds and with that can detect if the price has gone up or down xx points

I made such EA already for someone.....  But how to do I don't give for free because I was paid for making it.... 

 
deVries:

I know that it is possible to make function that detects the different prices in xx seconds and with that can detect if the price has gone up or down xx points

I made such EA already for someone.....  But how to do I don't give for free because I was paid for making it.... 


Tjipke,

If your post insinuates I'm asking for information needing to be paid for, please announce this now. If not, please express the meaning of your post.


Thank you
 
WhooDoo22:

Tjipke,

If your post insinuates I'm asking for information needing to be paid for, please announce this now. If not, please express the meaning of your post.


Thank you

tell you there is a solution to make it....

you have your answer to your question to  RaptorUK 

 
WhooDoo22:

Simon,

Will this method consistently track seconds within the strategy tester?


RaptorUK:
. . . .    it's not very elegant so I wouldn't suggest anyone use it. 

 

You cannot track seconds in the Strategy Tester . . .   you need to read more of what people write to you,  when you don't understand something explain specifically what you don't understand and ask.  The Strategy Tester does not give you a second by second replay of time . . .  it gives you tick by tick,  think of it like analogue vs digital . . . why do you need every second if nothing happened during most of them ?  if you have a steady state for 30 seconds why do you need to experience the same state for 30 seconds ?

 
WhooDoo22:

Simon,

This should depend on the format and intended use of TimeSeconds(datetime time) with the determined datetime time used.


All due respect, I believe your statement to be too general to answer correctly. "Lets assume you have 2 events and these events are 10 seconds apart,..." What event in particular? Tick creations?

Ok, lets assume tick creations are what you do mean. Also, I'm assuming by datetime time you mean TimeCurrent(). Again, if this is also your meaning, if there are no ticks for ten seconds and then a tick is then created, the seconds of time "gap" is ten and a tick is created either on the tenth second or the eleventh. I believe I understand what you are trying to relate.

I believe I could simply track the second whenever a tick is formed and keep up with seconds in this manner. Whew, ;) Hahaha! Wow.

I specifically asked about the TimeSeconds(datetime time) function,  your answer was . . . . ?  10 seconds ?  if it was then you are incorrect,  read the documentation on this function.  

By the way,  my question was very specific and in no way whatsoever was it ". . .  too general to answer correctly."   a datetime is a datetime is a datetime is a datetime . . .   it matters not if it's the datetime for a tick returned by TimeCurrent(), TimePrevious(), TimeLastWeekOnWednesdayNight() or any other datetime . . .  TimeSeconds() returns an int  so what will be the difference for the 2 ints returned for datetime1 and  (datetime1 - 10) ?

 
RaptorUK:


 

You cannot track seconds in the Strategy Tester . . .   you need to read more of what people write to you,  when you don't understand something explain specifically what you don't understand and ask.  The Strategy Tester does not give you a second by second replay of time . . .  it gives you tick by tick,  think of it like analogue vs digital . . . why do you need every second if nothing happened during most of them ?  if you have a steady state for 30 seconds why do you need to experience the same state for 30 seconds ?

you need to read more of what people write to you,  when you don't understand something explain specifically what you don't understand and ask.

Advice heeded and appreciated.


Thank you

 
RaptorUK:

I specifically asked about the TimeSeconds(datetime time) function,  your answer was . . . . ?  10 seconds ?  if it was then you are incorrect,  read the documentation on this function.  

By the way,  my question was very specific and in no way whatsoever was it ". . .  too general to answer correctly."   a datetime is a datetime is a datetime is a datetime . . .   it matters not if it's the datetime for a tick returned by TimeCurrent(), TimePrevious(), TimeLastWeekOnWednesdayNight() or any other datetime . . .  TimeSeconds() returns an int  so what will be the difference for the 2 ints returned for datetime1 and  (datetime1 - 10) ?

Your question may be specific according to you but if it's not specific according to me, how can you expect me to provide you with a correct answer without understanding your question? Nevertheless, I've reviewed documentation for the TimeSeconds() function and added a snip of it to SRC below.

int TimeSeconds(datetime time) 

// Returns the amount of seconds elapsed from the beginning of the minute for the specified time.

I'll run this function in a comment through the tester to fully understand its format.


a datetime is a datetime is a datetime is a datetime . . . (Emphasis? I think I got it the first two datetimes, Simon. LOL!)


it matters not if it's the datetime for a tick returned by TimeCurrent(), TimePrevious(), TimeLastWeekOnWednesdayNight() or any other datetime . . .  (last two periods are invisible. I don't see them)

TimeSeconds() returns an int  so what will be the difference for the 2 ints returned for datetime1 and  (datetime1 - 10) ?


According to TimeSeconds() documentation, this function returns integer value (exactly as you write).


so what will be the difference for the 2 ints returned for datetime1 and  (datetime1 - 10) ?

Why didn't you just write something along the lines of, "What's the difference between the two integers returned by the TimeSeconds() function?".

Apologies, it's difficult for me to read the sentence, "so what will be the difference for the 2 ints returned for datetime1 and  (datetime1 - 10) ?"


Can you please restate your question possibly in a more direct format?


Thank you

 
WhooDoo22:

Can you please restate your question possibly in a more direct format?

OK,  you can't get more direct than this:

Without running any code,  just by simple logic and your knowledge of the   TimeSeconds()  function,  what is the final value of the variable Difference ?

datetime SomeTime = 10000;
int Difference = 0;

Difference = TimeSeconds(SomeTime + 10) - TimeSeconds(SomeTime);

//  Difference has a value of ? ?