Hello,
Is it possible to get the sector information for the BSE / NSE market? I am in the process of testing the fundamental data for indian market.
Thank you and let me know if you need any further information.
from quantopian.pipeline import Pipeline, CustomFactor
from quantopian.research import run_pipeline
from quantopian.pipeline.data.factset import Fundamentals
from quantopian.pipeline.factors import SimpleMovingAverage, AverageDollarVolume
import quantopian.pipeline.data.factset.estimates as fe
from quantopian.pipeline.data import EquityPricing
from quantopian.pipeline.domain import IN_EQUITIES
import numpy
def make_pipeline():
market_cap = Fundamentals.mkt_val.latest
price = EquityPricing.close.latest
total_revenue = Fundamentals.sales_ltm.latest
divident_yieldcf = Fundamentals.div_yld_cf.latest
debt_loadf = Fundamentals.debt_assets_qf.latest
current_ratio_f=Fundamentals.curr_ratio_qf.latest
pe_cf =Fundamentals.pe_cf.latest
pbk_cf = Fundamentals.pbk_cf.latest
#free_cf_fcfe_af
#assets_gr_qf
#define screeners
current_ratio_filter = (current_ratio_f >1.5)
pe_filter_1 = (pe_cf < 20)
pe_filter_2 = (pe_cf > 1)
pb_ratio_filter = pbk_cf < 1.2
debt_loadf_filter = debt_loadf < 1.1
dividend_yield_filter = (divident_yieldcf > 1)
total_revenue_filter = total_revenue > 200000000
market_cap_filter = market_cap > 10000000000
#output designation
return Pipeline(
columns = {
'marketcap': market_cap,
'price': price,
'current_ratio_f': current_ratio_f,
'pe_cf': pe_cf,
'total_revenue': total_revenue,
'divident_yield': divident_yieldcf,
'debt_load':debt_loadf,
'pbk_cf':pbk_cf,
'economy':Fundamentals.RBICSFocus.l1_name.latest
},domain=IN_EQUITIES,screen= (market_cap_filter & pe_filter_1 & pe_filter_2)
)
result = run_pipeline(make_pipeline(),'2019-01-30','2019-01-30').sort_values(by=['price'], ascending=False)
print 'Number of securities that passed the filter: %d' % len(result)
result['asset_name'] = [str(asset.asset_name) for asset in result.index.get_level_values(level=1)]