I'm new to MC and I'm wondering how to get the creation time of tick bar.
Please verify below code.
Any helps would be appreciated.
Thanks.
Code: Select all
VARS: STimeToSecond(0), TimeToSecond(0), TicksInterval(0);
VARS: SetStartTime1(0), SetStartTime2(0), SetEndTime1(0), SetEndTime2(0);
// Get the start of bar time
SetStartTime1 = (TimeToMinutes(Time_s[1]) * 60);
SetStartTime2 = (FracPortion(Time_s[1] / 100) * 100);
STimeToSecond = (SetStartTime1 + SetStartTime2);
// Get the end of bar time
SetEndTime1 = (TimeToMinutes(Time_s) * 60);
SetEndTime2 = (FracPortion(Time_s / 100) * 100);
TimeToSecond = (SetEndTime1 + SetEndTime2);
TicksInterval = (TimeToSecond - STimeToSecond);