warensoft 我是科学家

Warensoft 我是科学家

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Warensoft Stock Service Api客户端接口说明

Warensoft Stock Service Api Client Reference

      本项目客户端驱动源码已经发布到GitHub上,地址如下:

      https://github.com/warensoft/stockserviceclient

  1. 项目说明

Warensoft Stock Service为用户提供在线的金融算法服务,本客户端已经将通信协议进行了封装,以便于C#开发人员调用。

目前处于测试阶段,用户可以使用测试用AppKey和SecretKey,该密钥对将于2017年5月10日过期!

      2. 可使用环境(Available Environments)

本客户端被编译为.net standard 1.6。支持的运行环境如下:

This client was compiled to .net standard 1.6, and the follow runtime are supported:

运行时

版本

.net standard

1.6+

.net framework

4.6.1+

Portable

259

Xamarin

 

 

       3.安装(Setup)

本客户端需要通过Nuget方式进行安装,用户可以在Nuget中搜索“Warensoft”,并选择安装Warensoft.EntLib.StockServiceClient如果客户端需要使用MVVM模式,则可以选择安装Warensoft.EntLib.Common,如下图所示:

This client needs to be installed through Nuget. Users could find this component by typing “Warensoft”, and then install “Warensoft.EntLib.StockServiceClient”. If your client needs MVVM pattern support, you could also install “Warensoft.EntLib.Common”:

 

 

        4.接口支持的功能(2017.1.12版本)(Methods supported by this Client)

其类图如下所示:

The class diagram is shown as bellow:

 

 

功能清单如下:

The Methods are listed as bellow:

接口名

说明

GetATR

根据K线获取平均真实波幅曲线

Get ATR indicator

GetEMA

根据K线获取指数平均数指标

Get EMA indicator

GetKline

根据Ticker值获取其K线

Get K line by ticker

GetMACD

据K线获取指数平滑移动平均线

Get MACD indicator

GetRSI

据K线获取相对强弱指标

Get RSI indicator

GetSAR

据K线获取抛物线指标

Get SAR indicator

GetSMA

据K线获取简单平均数指标

Get SMA indicator

GetWR

据K线获取Williams %R指标

Get Williams %R indicator

 

       5.Api调用方法(Invoking API)

  • 初始化客户端驱动,此处使用的是测试用AppKey和SecretKey.(Initializing the client driver. Notice: the AppKey and SecretKey are test values, so DO NOT use them in Production Environment)

        

var driver = new StockServiceDriver("C6651783-A3B9-4B72-8B02-A2E67A59C5A6", "6C442B3AF58D4DDA81BB03B353C0D7D8");

 

  •  获取目标K线(Obtain the target k lines)
List<Kline> kline = LoadKline();

 

  • 调用所需接口(Invoke the interface you need)
var atr=driver.GetATR(kline,10);
var ema=drvier.GetEMA(kline,10);
…

 

作者:科学家

                                                    Email:warensoft@163.com

                                                    微信:43175692

posted on 2017-01-12 18:20  王宇 warensoft  阅读(1095)  评论(0编辑  收藏  举报