Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Probability State Indicator (PSI)

Just wanted to share a POC for the Probability State Indicator (PSI). Simon linked to it a while back

http://www.priceactionlab.com/Blog/2013/09/psi-the-probability-state-indicator/

Turns out it was fairly easy to reverse from the screenshot. It seems a little too simple but I'd be interested if anyone has a strategy for it. Basically, the closer the price is to the high of n periods, then the closer it is to 1. The inverse is true for the lows



delta = highest_high - lowest_low

delta_diff = highest_high - current_price

def calculate_psi(delta,delta_diff):  
    psi = (delta - delta_diff)/delta  
    return psi  
13 responses

when would the current_px / (max(n)-min(n)) ever be < 1.0?

you're right, it needs to be adjusted first.. fixing it now.

fixed

ok. See what you mean now...test it. Shouldn't be too hard..Of course you can boil what this is saying to the following:

1) are we near the n day high? 1 = yes, 0 = nope, 0> x <1 = sorta

Not sure why this would be predictive of tomorrow outside of the usual measures of momentum/reversion

I would have thought this indicator was more like fitting a Brownian motion to the recent past and then returning the probability of the indicator function for touching the barrier (of the high).

I can see how it could be applied to identify trends or ranges. If one takes a sampling of PSI results for a given timeframe and there are more values over .90 (for example) than there are values below (.10) then an uptrend can be presumed. Or if most of the values are in the middle, then a sideways market could be identified

This looks to be the only difference :

(Current Close - Lowest Low) is replaced with (Highest High - Current Close)

and its not multiplied by 100. And no MA.

Delta= HH-LL
Delta_Diff=HH-C
PSI=(Delta-Delta_Diff)/Delta

PSI= ((HH-LL)-(HH-C))/(HH-LL)

PSI= (C-LL)/(HH-LL)

If multiplied by 100 PSI will be exactly the same as 65 years old George C. Lane Stochastic Oscillator %K (talib.STOCHF).

I'll bet that's why the formula wasn't shared on the blog

You guys are still talking about your own version of the PSI, which you deduced by eyeballing an image on a web page, right?

You can compare the results from this to the screenshot of the blog and you'll see its exactly the same. Don't know what the chance of the output being the same with a different formula would be, but I'm sure its minuscule.

As I mention above
If multiplied by 100 PSI will be exactly the same as 65 years old George C. Lane Stochastic Oscillator %K (talib.STOCHF).