-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
adds proper sell rounding to avoid LOT errors #79
base: main
Are you sure you want to change the base?
Conversation
… using an editor; adds handling when someone uses a version without trailing loss/profit; adds .gitignore; updates SDK to recent version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better than my fixes. nice one
Binance Detect Moonings.py
Outdated
|
||
sell_amount = coins_bought[coin]['volume'] | ||
tick_size = float(next( | ||
filter(lambda f: f['filterType'] == 'LOT_SIZE', client.get_symbol_info(coin)['filters']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you can cache lot_size into coins_bought.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense. I'll implement it.
adds try/except instead of if
Been running this version for some hours now. Not even one error occured. :) |
Been testing for a while here too, and so far no errors. Thanks! |
@CyberPunkMetalHead this one seems important to merge |
@hExPY Can you please resolve conflicts? |
Was on vacation. Now I merged. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an official dev for this project, but left some suggestions. Feel free give your opinion on them
Binance Detect Moonings.py
Outdated
try: | ||
TP = float(coins_bought[coin]['bought_at']) + ( | ||
float(coins_bought[coin]['bought_at']) * coins_bought[coin]['take_profit']) / 100 | ||
SL = float(coins_bought[coin]['bought_at']) + ( | ||
float(coins_bought[coin]['bought_at']) * coins_bought[coin]['stop_loss']) / 100 | ||
# When an older version of the script is being executed | ||
except KeyError: | ||
TP = float(coins_bought[coin]['bought_at']) + (float(coins_bought[coin]['bought_at'])) / 100 | ||
SL = float(coins_bought[coin]['bought_at']) + (float(coins_bought[coin]['bought_at'])) / 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be a good idea to put coins_bought[coin]['bought_at']
into a variable to avoid repeating it too much?
Code might be cleaner
tick_size = float(next( | ||
filter(lambda f: f['filterType'] == 'LOT_SIZE', client.get_symbol_info(coin)['filters']) | ||
)['stepSize']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to be too long. Is there any way to make it more readable? (I really don't know)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested this yet, will it leave crypto dust for people using BNB for fees?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it will leave crypto dust which can be changed into BNB afterward.
adds code review changes
TP = BuyPrice + (BuyPrice) * coins_bought[coin]['take_profit']) / 100 | ||
SL = BuyPrice + (BuyPrice) * coins_bought[coin]['stop_loss']) / 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't run. Remove the extraneous parenthesis:
TP = BuyPrice + (BuyPrice) * coins_bought[coin]['take_profit']) / 100 | |
SL = BuyPrice + (BuyPrice) * coins_bought[coin]['stop_loss']) / 100 | |
TP = BuyPrice + (BuyPrice) * coins_bought[coin]['take_profit'] / 100 | |
SL = BuyPrice + (BuyPrice) * coins_bought[coin]['stop_loss'] / 100 |
Adds proper coin rounding in order to fix LOT error; reformat file; adds handling when someone uses a version without trailing loss/profit; adds .gitignore; updates SDK to recent version