Need help..!

#1
I need to write for buy condition is daily and sell condition weekly! how i can write?

For example;

Buy= ref(RSI(7),-1))<30 AND RSI(7)>30; (This condition is daily)

Sell= ref(RSI(7),-1))>70 AND RSI(7)<70; (this condition is weekly)


Thanks for help!