1. 程式人生 > >利用Warensoft Stock Service編寫高頻交易軟體--客戶端驅動介面說明

利用Warensoft Stock Service編寫高頻交易軟體--客戶端驅動介面說明

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:[email protected]

                                                    微信:43175692