frame (int Offset): bool
Returns true when the current TimeFrame ends at the given bar.
frameSync (int Period): int
Synchronizes TimeFrame to a half hour, a hour, a 4 hours period, a day, or a week.
Causes 30-min time frames to end either at a full or a half hour, 1-hour time frames at
every full hour, 4-hour time frames at a
multiple of 4 hours after midnight, daily time frames at midnight, and weekly
time frames at the end of the week. Periods higher than one week or lower than
30 minutes are not synchronized. FrameOffset can be used
to shift the synchronized time frame to a particular time or workday. Returns 0 inside the time frame, and the negative number of skipped bars at the end of the time frame.
||Bar distance to the current bar. Must be 0 when TimeFrame is synchronized to a fixed time period or to an external event.
||Time period to be synchronized, in bars; either a half hour, a hour, a 4
hours period, a day, or 7 days for a week.
- TimeFrame = 24 is different to TimeFrame = frameSync(24). In the former case the time frame changes every 24 bars, in the latter case every day
on a 1-hour bar period, even if there
are less than 24 bars per day.
- The Period parameter to be synchronized on must not
change from bar to bar.
- Not all functions support synchronized time frames, but
series do. For synchonizing TimeFrame to arbitrary events, look up
the frameAlign helper function under Tips&Tricks.
- TimeFrame = frameSync(...) will not automatically set
LookBack, so always set it manually to the needed
maximum value when using variable time frames.
BarPeriod = 60;
FrameOffset = 3;
TimeFrame = frameSync(24);
// the time frame will now change daily at 3:00
Bar, TimeFrame, BarZone, BarMode,
► latest version online