Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Trending Up / Trending Down

I'd like to find out which stocks are likely long and which ones are likely to be short.

I don't think this can be implemented yet as it depends on ta_lib.
ta_lib has a suite of candlestick chart analyzers. Both candlestick charts and candlestick patterns originated in Japan. Here's what I've got so far in pseudo-code:

s[1] = sid(1)  
s[2] = sid(2)  
s[3] = sid(3)  
      :  
s[n] = sid(n)

# for each sid  
for theSid = 1:n  
    mode = "unknown"  
    # Bullish Candlestick indicators  
    if(CDL3WHITESOLDIERS(s[theSid]))  
        match = match + "CDL3WHITESOLDIERS/"  
        mode = "bull"  
    end  
    if (CDLMORNINGDOJISTAR(s[theSid]))  
        match = match + "CDLMORNINGDOJISTAR/"  
        mode = "bull"  
    end  
           :  
    # Bearish Candlestick indicators  
    if(CDLSEPARATINGLINES(s[theSid]))  
        match = match + "CDLSEPARATINGLINES/"  
        mode = "bear"  
    end  
    if (CDLKICKING(s[theSid]))  
        match = match + "CDLKICKING/"  
        mode = "bear"  
    end  
           :  
end  

From there, a list could be built of any stocks showing bull or bear signs. The algo could then short the bulls and go long on the bears.