counting seconds inside the bar
Questions about MultiCharts and user contributed studies.
9 posts • Page 1 of 1
- Posts: 7195
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 990 times
- Been thanked: 2049 times
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.
ComputerDateTime will return a value of 39448.25000000 for 6:00 AM on January 1st, 2008
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.
Code: Select all
SecondsInBar = 10;
MidBarStall = 8;
If Mod(SecondsfromDateTime(ComputerDateTime),SecondsInBar) >= MidBarStall then
do whatever you want in here;