From 97c244893c49698f59d706bca3c346ef37f1e263 Mon Sep 17 00:00:00 2001 From: sniper24 Date: Mon, 21 Mar 2016 00:22:15 +0800 Subject: [PATCH 1/2] Update test.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改getPriceHisory方法的入参格式 --- vn.oanda/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vn.oanda/test.py b/vn.oanda/test.py index e86559bb..eb3fdb88 100644 --- a/vn.oanda/test.py +++ b/vn.oanda/test.py @@ -19,7 +19,7 @@ if __name__ == '__main__': #api.getPrices({'instruments': 'EUR_USD'}) # 获取历史数据,失败 - #api.getPriceHisory({'instruments': 'EUR_USD', + #api.getPriceHisory({'instrument': 'EUR_USD', #'granularity': 'D', #'candleFormat': 'midpoint', #'count': '50'}) @@ -102,4 +102,4 @@ if __name__ == '__main__': #api.getAutochartist({'instrument': 'EUR_USD'}) # 阻塞 - input() \ No newline at end of file + input() From 5f65f553b8d1b9f7e42ceef2e79dd41552733bcf Mon Sep 17 00:00:00 2001 From: sniper24 Date: Mon, 21 Mar 2016 00:24:37 +0800 Subject: [PATCH 2/2] Update vnoanda.py --- vn.oanda/vnoanda.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vn.oanda/vnoanda.py b/vn.oanda/vnoanda.py index 6272b651..a1ff6f30 100644 --- a/vn.oanda/vnoanda.py +++ b/vn.oanda/vnoanda.py @@ -87,7 +87,7 @@ class OandaApi(object): self.initFunctionSetting(FUNCTIONCODE_GETPRICES, {'path': '/v1/prices', 'method': 'GET'}) - self.initFunctionSetting(FUNCTIONCODE_GETPRICEHISTORY, {'path': 'v1/candles', + self.initFunctionSetting(FUNCTIONCODE_GETPRICEHISTORY, {'path': '/v1/candles', 'method': 'GET'}) self.initFunctionSetting(FUNCTIONCODE_GETACCOUNTS, {'path': '/v1/accounts', @@ -605,4 +605,4 @@ class OandaApi(object): if not self.active: break else: - self.onError(error, -1) \ No newline at end of file + self.onError(error, -1)