哪个大佬帮我看看代码哪里出问题了 我用python写的,想持仓量大于0的时候进行平仓操作,然后回测的时候报错了,显示这个raceback (most recent call last): File “”, line 1606, in Run File “”, line 57, in File “”, line 20, in main TypeError: ‘NoneType’ object is not subscriptable
amount = 2 if exchange.GetPosition()[‘Amount’] > 0 : exchange.Buy(-1,amount) #买入平空