To create and keep a weekly value (pivot point) and use that value for calculations on a daily timeframe, what should I do?

To date I have tried using the static variable but the value is 0 within the run() function. Should I post the code?