Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Parabolic SAR Using TA-Lib

After searching the forums, and not much information via replies, has anyone successfully implemented an algorithm that uses the TA-Lib parabolic SAR? I've seen almost every strategy implemented in one way or another since I've started lurking except for this one. Unfortunately, I think I'm still a bit too novice as a coder to write a decent implementation myself (still getting the hang of very basic rebalance algorithms), but has anyone else had success? Or written any experiments using it?

9 responses

I have been trying to do the same thing using pipeline by " Custom Factor" within the research environment, some of TA-Lib is already imported but not SAR. I have been able to successfully use SAR in the research environment , without pipeline. And been able to create graphs, but have not tried it back test IDE.

If you manage to get it working, please share. SAR is the backbone of my real-life trading strategy, and I've so far been unable to get any sort of usefulness out of it Quantopian.

Any progress, Alfred?

high = MAX(close, timeperiod=30)
low = MIN(close, timeperiod=30)
parabolicsar = talib.SAR(high, low, acceleration=0.02, maximum=0.2)[-1]

stk= symbol('SPY')
close = data.history(stk, 'price', 30, '1d')
high = MAX(close, timeperiod=30)
low = MIN(close, timeperiod=30)
parabolicsar = talib.SAR(high, low, acceleration=0.02, maximum=0.2)[-1]

I had it working but deleted it from my algorithm because it seemed ineffective. A moving average crossover is probably a better stop loss than parabolic sar.

talib SAR Indicator

This is similar to Vlad

Vladamir, I would've never guessed it would be so simple with the TA-Lib documentation I found. Thank you!

Thank you!