#define M1 (1/BarPeriod)
#define M5 (5/BarPeriod)
#define M30 (30/BarPeriod)

and

TimeFrame = frameSync(M1 );
...