TimeFrameCompress inWeekly for crypto

As crypto trades 24/7, if we were, for example, trying to get a weekly moving average plotted (on for example a daily chart), is it accurate to write;

wc = TimeFrameCompress( Close, 7*inDaily );
weeklyma = MA( wc, 14 );
weeklyma = TimeFrameExpand( weeklyma, 7*inDaily );
Plot( weeklyma, "WeeklyMA", colorBlue );

Yes, but use inWeekly constant.

I read on the timeframeset page that;

inWeekly = 5 * 24 * 3600 + 1 = 432001

So I assumed that inWeekly was the function to call for stocks and forex, but it would not capture weekend OHLCV data for crypto (at least for TimeFrameSet() anyway). Does it not when we are using TimeFrameCompress()?

Weekly compression is user-definable and uses "Start day of the week" as set in File->Database Settings/Intraday Settings

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.