pythonでoandaのAPIを使ってオーダーを送りたいと考えています
しかしエラーが出てしまいうまくいきません
どのようにすればよいでしょうか?
python
1import oandapyV20 2import oandapyV20.endpoints.orders as orders 3accountID = ACCOUN_ID 4api = oandapyV20.API(access_token=ACCESS_TOKEN) 5 6data = { 7 "order": { 8 "instrument": "USD_JPY", 9 "units": "+100", 10 "type": "MARKET", 11 "positionFill": "DEFAULT" 12 } 13} 14r = orders.OrderCreate(accountID , data=data) 15api.request(r)
次のようなエラーです
python
1V20Error Traceback (most recent call last) 2<ipython-input-41-41ae4b5fe2fa> in <module>() 3 14 } 4 15 r = orders.OrderCreate(accountID , data=data) 5---> 16 api.request(r) 6 7~\Anaconda3\lib\site-packages\oandapyV20\oandapyV20.py in request(self, endpoint) 8 304 9 305 response = self.__request(method, url, 10--> 306 request_args, headers=headers) 11 307 content = response.content.decode('utf-8') 12 308 content = json.loads(content) 13 14~\Anaconda3\lib\site-packages\oandapyV20\oandapyV20.py in __request(self, method, url, request_args, headers, stream) 15 241 response.content.decode('utf-8')) 16 242 raise V20Error(response.status_code, 17--> 243 response.content.decode('utf-8')) 18 244 return response 19 245 20 21V20Error: {"errorMessage":"Insufficient authorization to perform request."}

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。