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

Kraken Api, place order #89

Open
hammerjoe opened this issue Dec 30, 2023 · 1 comment
Open

Kraken Api, place order #89

hammerjoe opened this issue Dec 30, 2023 · 1 comment

Comments

@hammerjoe
Copy link

I am trying to create a limit order but I am getting the error EGeneral:Invalid arguments:ordertype and I cant figure it out.

This is the code to make the call
Dim Params as Dictionary
Order_Type = "limit"
Trade_Type = "sell"
new_volume_pair = 0.01
Params.Add "apiKey", Apikey
Params.Add "secretKey", secretKey
Params.Add "ordertype", Order_Type
Params.Add "type", Trade_Type
Params.Add "volume", new_volume_pair
Params.Add "price", token_price
response = PrivateKraken("AddOrder", "POST", Params)

What am I getting the error about the ordertype??

@hammerjoe
Copy link
Author

For those that had the same issue here is the solution:

Need to provide two dictionaries to the call.

Cred.Add "apiKey", Apikey
Cred.Add "secretKey", secretKey
Params.Add "ordertype", Order_Type
Params.Add "type", LCase(Trade_Type)
Params.Add "volume", new_volume_pair
Params.Add "price", token_price
Params.Add "nonce", CStr((CLng(Now) * 1000))
response = PrivateKraken("AddOrder", "POST", Cred, Params)

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