Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitget.exceptions.BitgetAPIException: API Request Error(code=40808): Parameter verification exception 0 #30

Open
ethyuyi opened this issue Jan 31, 2023 · 0 comments

Comments

@ethyuyi
Copy link

ethyuyi commented Jan 31, 2023

執行 python 中的 planApi.place_plan() 也就是下方的 example
result = planApi.place_plan(symbol, marginCoin='USDT', size='0.001', side='open_short', orderType='limit', triggerPrice='22222', executePrice='22222', triggerType='fill_price', timeInForceValue='normal', clientOrderId='1004322029588606977')
print(result)

出現 bitget.exceptions.BitgetAPIException: API Request Error(code=40808): Parameter verification exception 0

發現在 /bitget/mix/plan_api.py
place_plan 檔案中的下方兩行
params["presetTakeProfitPrice"] = presetTakeProfitPrice
params["presetStopLossPrice"] = presetStopLossPrice

presetStopLossPrice 以及 presetStopLossPrice 值為空的時候如果出現在 params 會出現錯誤

改為
if presetTakeProfitPrice != '':
params["presetTakeProfitPrice"] = presetTakeProfitPrice
if presetStopLossPrice != '':
params["presetStopLossPrice"] = presetStopLossPrice
可以解決錯誤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant