Hello Abel, there are some talib.RSI() examples here. Or in a search engine for more discussion: rsi quantopian
On Quantopian currently in 2014 there some things to watch out for:
1. It allows borrowing by default (good for some, requiring extra code for others)
2. Percent Returns right now are calculated based on the GUI setting (a million in this case) and do not take borrowing into account.
In this version of the algo I added some cash tracking (and bumped one of your items for record() of cash since it is limited to five).
You could do the math for output/input for the real return (in my opinion) including the max borrowed $149 million as input.
And then, if by chance you might want to try trading just once per day while using history() which requires minute mode, could try something like:
def handle_data(context, data):
time = str(get_datetime().time()) # is your local time, look up astimezone timezone 'US/Eastern' to convert
if time != '15:24:00': # only trading at this time once a day
return