Notebook
In [9]:
from quantopian.pipeline import Pipeline  
from quantopian.pipeline.data import EquityPricing, factset  
from quantopian.pipeline.domain import IN_EQUITIES
from quantopian.research import run_pipeline
from quantopian.pipeline.factors import SimpleMovingAverage, CustomFactor, Returns
import numpy as np 



# value stock screening 
#ltd_to_eq = factset.Fundamentals.debt.latest/factset.Fundamentals.eq_tot.latest
#ltd_to_eq =ltd_to_eq.rank(ascending=True)
#filter_ltd_to_eq =ltd_to_eq<200

#ROIC  = factset.Fundamentals.com_eq_retain_earn.latest/(factset.Fundamentals.debt.latest + factset.Fundamentals.eq_tot.latest)
#ROIC = ROIC*100
#filter_roic = ROIC>10

#is_tradeable =  filter_ltd_to_eq & filter_roic

pipe = Pipeline(  
    columns={  
        'price': EquityPricing.close.latest,  
        'volume': EquityPricing.volume.latest,  
        #'mcap': factset.Fundamentals.mkt_val.latest,
        #'listing exchange':factset.EquityMetadata.primary_fsym_security_id.latest,       
        #'security type':factset.EquityMetadata.security_type.latest,
        #'ltd_to_eq': ltd_to_eq.rank(ascending=True),
        #'ROIC' : ROIC
    },  
    domain=IN_EQUITIES,
   # screen = is_tradeable
)

result = run_pipeline(pipe, '2018-01-15', '2019-01-15')  


result['exchange'] = [str(asset.exchange) for asset in result.index.get_level_values(level=1)]
result['symbol'] = [str(asset.symbol) for asset in result.index.get_level_values(level=1)]

result = result.loc['2018-01-15',:][result['exchange']=='NSE']

Pipeline Execution Time: 0.25 Seconds
/venvs/py35/lib/python3.5/site-packages/ipykernel_launcher.py:41: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
In [10]:
result.shape
Out[10]:
(103, 4)