-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add the truncate
parameter to kraken.spot.Trade.create_order
#95
Merged
btschwertfeger
merged 12 commits into
master
from
94-tradecreate_order-ability-to-use-floats-as-trade-amounts-or-prices
May 20, 2023
Merged
Add the truncate
parameter to kraken.spot.Trade.create_order
#95
btschwertfeger
merged 12 commits into
master
from
94-tradecreate_order-ability-to-use-floats-as-trade-amounts-or-prices
May 20, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btschwertfeger
added
enhancement
New feature or request
Spot
Topic related to Spot trading
labels
May 18, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #95 +/- ##
==========================================
+ Coverage 86.03% 86.33% +0.29%
==========================================
Files 17 18 +1
Lines 1425 1456 +31
==========================================
+ Hits 1226 1257 +31
Misses 199 199
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hey @andyDoucette - is there anything missing? |
btschwertfeger
deleted the
94-tradecreate_order-ability-to-use-floats-as-trade-amounts-or-prices
branch
May 20, 2023 05:11
btschwertfeger
added a commit
that referenced
this pull request
Mar 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
As described in #94, in some cases the Kraken API returns invalid volume or invalid price errors, since Python creates strings like "1e-05" from float values like 0.00001 which cannot be interpreted by the Kraken API. To also ensure that users of the python-kraken-sdk don't need to worry about the right rounding, the new
truncate
function was implemented that can roundvolume
andprice
. If the newtruncate
parameter ofkraken.spot.Trade.create_order
is set toTrue
, the price and volume will be rounded to the lowest - last decimal.The
price2
parameter is not affected since that would break the custom commands described in Kraken Docs addOrder Closes: #94Also the
kraken.spot.Trade.create_order
examples were adjusted. Closes #96