我想向oanda发送订单进行交易,我使用ipython notebook编译我的代码,这是我的代码:
import oandapy
trade_expire=datetime.now()+timedelta(days=1)
trade_expire=trade_expire.isoformat("T")+"Z"
oanda=oandapy.API(environment='practice',access_token='XXXX....')
account_id=xxxxxxx
response=oanda.create_order(account_id,instrument='USD_EUR',units=1000,side='buy',/
type='limit',price=1.105,expire=trade_expire)
Run Code Online (Sandbox Code Playgroud)
但错误是?
OandaError: OANDA API returned error code 4 (The access token provided does
not allow this request to be made)
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
我正在研究如何在ipython笔记本中使用pandas:
import pandas as pd
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-17-c7ecb2b0a99d> in <module>()
----> 1 from pandas import *
D:\Anaconda\lib\site-packages\pandas\__init__.py in <module>()
20
21 # numpy compat
---> 22 from pandas.compat.numpy import *
23
24 try:
D:\Anaconda\lib\site-packages\pandas\compat\numpy\__init__.py in <module>()
8
9 # numpy versioning
---> 10 _np_version = np.version.short_version
11 _nlv = LooseVersion(_np_version)
12 _np_version_under1p8 = _nlv < '1.8'
AttributeError: module 'numpy' has no attribute 'version'
Run Code Online (Sandbox Code Playgroud)
我不知道如何解决它,问题是什么?我的python的版本是3.6