Python
1# アカウントのオープントレードを全て取得する 2r = trades.TradeDetails(accountID=accountID, tradeID=9) 3print(api.request(r)) 4 5# 決済 6r = trades.TradeClose(accountID=accountID, tradeID=9, data=5000) 7print(api.request(r))
以上のコードで決済しようと考えています。
ところが、以下のようなエラーがでてしましました。
Traceback (most recent call last): File "oanda.py", line 50, in <module> print(api.request(r)) File ".pyenv/versions/3.6.1/lib/python3.6/site-packages/oandapyV20/oandapyV20.py", line 306, in request request_args, headers=headers) File ".pyenv/versions/3.6.1/lib/python3.6/site-packages/oandapyV20/oandapyV20.py", line 243, in __request response.content.decode('utf-8')) oandapyV20.exceptions.V20Error: {"errorMessage":"Invalid JSON body, must be an object"}
原因はどのように考えられるのでしょうか。
よろしくお願い致します。
あなたの回答
tips
プレビュー