Help with context.longs

Hello I want to put into context.long.sec a comparison between two moving averages. I want the algorithm to open long position when sma 10 > sma 30 and short positions in the opposite situations. The algorithm pasted under the post is an extract from the Sample Mean Reversion with my notes so you can understand what Im trying to do.

(I know I need to define the sma's above The algo)

#I want to do something like this
Def make_pipeline(context):
longs = sma10 > sma30
Shorts= sma10 < sma30