高盛数量
gs-quant的Python项目详细描述
GS数量
gs quant是一个用于量化金融的python工具包,它通过goldman sachs marquee developer api提供了对大量衍生品定价数据的访问。提供了用于TimeSeries分析、投资组合操作、风险和场景分析以及回测的库。可用于以编程方式与天棚平台交互,或作为用于量化分析的独立软件包。
由高盛(Goldman Sachs)的量化开发商(Quantitative Developers,简称Quants)创建和维护,用于制定交易策略和分析衍生产品。可用于促进衍生品结构和交易,或作为各种TimeSeries分析应用程序的统计包。
另请参阅gs quant文件夹或软件包中的入门笔记本。
安装
pip安装gs quant
GS用户:pip install gs quant[内部]--用户
依赖关系
python 3.6或3.7
包依赖项可以由pip安装。
示例
importdatetimeimportnumpyasnpimportpandasaspdfromgs_quant.dataimportDatasetfromgs_quant.instrumentimportIRSwapfromgs_quant.commonimportCurrency,PayReceiveimportgs_quant.riskasriskfromgs_quant.sessionimportEnvironment,GsSessionfromgs_quant.timeseriesimportvolatility# N.b., GsSession.use(Environment.PROD, <client_id>, <client_secret>, scopes=('read_product_data','run_analytics')) will set the default sessionwithGsSession.get(Environment.PROD,<client_id>,<client_secret>,scopes=('read_product_data','run_analytics')):# get coverage for a dataset; run a queryweather=Dataset('WEATHER')coverage=weather.get_coverage()# GS-specific functionalitydf=weather.get_data(datetime.date(2016,1,15),datetime.date(2016,1,16),city=['Boston','Austin'])# calculate vol for a time seriesrange=pd.date_range('1/1/2005',periods=3650,freq='D')series=pd.Series(np.random.rand(len(range)),index=range)# randomly generatedvol=volatility(series,252)vol.plot()# requires matplotlib# Non-GS users: the below functionality requires extra permissions# Please contact your sales coverage to request access# price an interest rates swap and compute its bucketed deltairs=IRSwap(PayReceive.Pay,"5y",Currency.USD,fixedRate=0.0275)pv=irs.price()ir_delta=irs.calc(risk.IRDelta)
帮助
写信给我们的通讯组列表:developer@gs.com