The ‚of‘ function
You can reference other time frames by using the ‚of‘ function. I have a more detailed description on another post so this is the abbreviated version.
Of „symbol, time period“
Close of „IBM“
MovingAvg (Close, 14) of „, weekly“
Range of „SP-200806, 15 minutes“
Please note that the is a comma before the time period in the example that only references a different time.
Another point is that this function as described works in strategy rules but not in custom functions.