hi
i hope you could help me to find a function that counts the # fo seconds since the bar started
if i use 5 min bars and i want to check a condition that can be met only after 4 min and not before
thanks
counting seconds inside the bar
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
ComputerDateTime
Returns a double-precision decimal DateTime value indicating the computer's current date and time.
The integer portion of the DateTime value indicates the number of days that have elapsed since January 1st, 1900, and the fractional portion of the DateTime value indicates the fraction of the day that has passed since midnight.
Usage
ComputerDateTime
Example
ComputerDateTime will return a value of 39448.25000000 for 6:00 AM on January 1st, 2008
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
you need to work on some basics...
may i suggest:
http://www.amazon.com/Ask-Mr-Easylangua ... 337&sr=8-1
may i suggest:
http://www.amazon.com/Ask-Mr-Easylangua ... 337&sr=8-1
Here is what you want exactly. the value 10 in the command below is your bar size in terms of seconds. So in my case it is a 10 second bar so I use value value 10. If you want to trigger on the 8th second and 9th second of the bar you set the variable MidBarStall to value 8 for the code below. Works perfectly.
John.
John.
Code: Select all
SecondsInBar = 10;
MidBarStall = 8;
If Mod(SecondsfromDateTime(ComputerDateTime),SecondsInBar) >= MidBarStall then
begin
do whatever you want in here;
end;
Re: counting seconds inside the bar
see response in User "Contributed studies" topic.
http://forum.tssupport.com/viewtopic.php?p=22761#22761
Cheers
http://forum.tssupport.com/viewtopic.php?p=22761#22761
Cheers