Why no result in column "weeklyclose compressed"?

I've read help document 'Multiple Time Frame support in AFL'
with the following code,
all other column seems to show 'normal' results,
but, there is no result in column "weeklyclose compressed" after [Explore],
Please help! Thank you very much :slight_smile: !

Filter = 1;
AddColumn(Close, "Dailyclose"); 
TimeFrameSet(inWeekly); 
AddColumn(wc = Close, "weeklyclose compressed"); 
TimeFrameRestore(); 
AddColumn( TimeFrameExpand(wc, inWeekly), "weeklyclose expanded");

timeframeExpand
also, I've done the following:
(1) Formula editor > Tool > Send to Analysis window
(2) Analysis > New Analysis > Backtester settings > Periodicity = Daily
(3) Apply to [*Current] Range[All quotes]

Hi @alexlin,

What is this line of coding doing?

Why do you want to return the compressed value?

TimeFrameSet(inWeekly);
WeeklyClosePrice = Close;
TimeFrameRestore();

WeeklyClosePrice_CurrentWeek = TimeFrameExpand(WeeklyClosePrice, inWeekly, expandFirst);
WeeklyClosePrice_PreviousWeek = TimeFrameExpand(WeeklyClosePrice, inWeekly, expandLast);

Filter = 1;
AddColumn(Close, "Daily Close", 1.3); 
AddColumn(WeeklyClosePrice_CurrentWeek, "Current Weekly Close", 1.3); 
AddColumn(WeeklyClosePrice_PreviousWeek, "Previous Weekly Close", 1.3);
AddColumn(WeeklyClosePrice, "Compressed Weekly Close", 1.3);

There is. Scroll to the bottom of the result list. As the function name tells you (as well as function reference in User guide) it outputs compressed data... So the data of longer interval is to be found at the end of the array and with n-number of NULLs at the start of the array (also see NullCount() function).


@TrendSurfer, the code is from user manual to explain/show difference between compression and expansion .

3 Likes

Where wc = compressed Close price in a week.
Where AddColumn() means to add a column for your Explore.

Code above was copied
from the help document
'Multiple Time Frame support in AFL',
except the nice link provided by fxshrat,
you can also get it on your formula editor,
type string "TimeFrameSet", click on it, press [F1],
finally you can see a link to 'Multiple Time Frame support in AFL' :smiley:.