Back to Posts
Listen to Thread

Hi all,

I've been meaning to play around with an RSI algo attempt posted a while back: https://www.quantopian.com/posts/rsi-attempt-general-questions-and-feedback

I had to make a few changes (see source) as context/data usage became different as the platform was upgraded...but I'm still getting an error and I'm a little confused why...

Any ideas?

Thanks
Alex

Clone Algorithm
7
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
There was a runtime error.

Hello Alex,

I'n sure there are better solutions but you could try

log.info(str(rsi))  
record(RSI=rsi)  

Regards,

Peter

Alex,

The problem is that it's having problems changing your integer to a string for logging. It works if you do it explicitly. Change line 76 from

    log.debug(rsi)  

to

    log.debug(str(rsi))  

For more readable logs, I'd combine lines 75 and 76 like this:
log.debug('RSI is: ' + str(rsi))

Ah simple enough, thanks.

I didn't realize it was something that simple causing the problem... when run step by step in isolation, this line was giving me problem (basically never ending)

        returns = [(preceding_prices[i-1]-preceding_prices[i]) for i in range(1,len(preceding_prices))]

but it seems to be fine now...

Log in to reply to this thread.
Not a member? Sign up!