yasinkuyu / binance-trader

💰 Cryptocurrency Trading Bot for Binance (Experimental)
2.54k stars 833 forks source link

Fixed open issues #109

Open WeSpeakCrypto opened 6 years ago

WeSpeakCrypto commented 6 years ago

I have been working on this based on the open issues / features. The only problem is that I don't know how to share it here. lol.

Current modifications:

Fixed buy and sell problems.

Auto round off buy and sell price to acceptable decimal points. This prevents error of PRICE_FILTER.

Stop loss will be activated if first sell price didn't go through. Computation: Sell price with profit minus percentage of sell price. If it still can't sell at that price. It will be sold at the market price.

After buy order entered. If the order didn't go through after 0.1 second. It will cancel.

If the buy is filled and sell is created. Wait 5 seconds. If sell is not filled. It will wait 5 seconds to prepare to sell at loss.

Flood prevention added. This will prevent the loop from running thus trying to buy or sell again while order is still waiting to be filled. Prevents UNKNOWN_ORDER error and Insufficient balance message.

Note:

--wait_time changed to float. Intervals can now check in milliseconds. Tested up to 0.7 now with 4 open windows. Default 0.7.

--amount added. --quantity don't have to be included if amount is added, else it will use the quantity provided. Default 0.0022. Default for quantity is 0. If not changed. It will use amount.

--increasing and --decreasing changed to percentage. This is due to fast changing market. It will have a better chance now to buy and sell rapidly. Default 0.2.

--stop_loss is now usable. Default 1.


To those who knows how to program. This is a hint of what needs to be changed. To those who are not. I'll try to share this if the owner will still not be active this week.

DVenerM commented 6 years ago

Hi! Can I get your program? add: I'm waiting changes from the author.

menz0050 commented 6 years ago

oh wow you added the option for btc amount instead of quantity nice job! I would also love to grab a copy.

yasinkuyu commented 6 years ago

@WeSpeakCrypto Please add your changes to the readme file (with examples). Then send a pull-request.

Thanks

yasinkuyu commented 6 years ago

@WeSpeakCrypto comment lines must be added when coding. :)

WeSpeakCrypto commented 6 years ago

@yasinkuyu Forgot about the comments. Maybe I'll be able to create pull-request on weekends with comments and examples. (Sadly. No more free time right now.) Also i'm still trying to catch a whale with this changes. No luck though. I think they're still sleeping. I'll keep this thread updated if I got something. :)

JustinHedge commented 6 years ago

Post a pulled repo of your updates if you can, would love to contribute as well!

WeSpeakCrypto commented 6 years ago

Hi, yes. Figured out I have to commit it to my own forked repo first before pull request. Unfortunately not today. Still have to add some things.

yasinkuyu commented 6 years ago

@WeSpeakCrypto You can often commit updates to your own fork. So we do not waste time making the same improvements. I'm making some improvements. Thank you.

WeSpeakCrypto commented 6 years ago

Hi, I tried to commit my changes in my forked branch: https://github.com/WeSpeakCrypto/binance-trader/commit/b7b308dfc8bbf0058343a179b6eda597655c84a9

You can now test it. I just made a mistake with Trading.py not inside apps. LOL. Just move it. Did not do pull request yet. I still have to add comments and change the readme (if yasinkuyu approves) :D

menz0050 commented 6 years ago

thanks for the update the --amount option doesn't seem to be working/added yet?

WeSpeakCrypto commented 6 years ago

@5AWTANGUS It is added. By default. It uses the amount option unless you added --quantity ### ?

menz0050 commented 6 years ago

@WeSpeakCrypto getting error: TabError: inconsistent use of tabs and spaces in indentation. on line 99 I think its caused by using a mixture of TAB and SPACES to indent

WeSpeakCrypto commented 6 years ago

Thanks! Created a new repo with proper commit. :) https://github.com/WeSpeakCrypto/binance-trader/commit/a8711cafbbf76a49c2098ad7e9153c6ae8719e5e

WeSpeakCrypto commented 6 years ago

Updated again. Forgot to revert some change after doing trials. :D

drekion commented 6 years ago

I'm trying @WeSpeakCrypto release, but If I dont have ETH, this stops printing text and waiting, is correct?

Auto Trading for Binance.com. --symbol: CNDETH 0.5% profit scanning for CNDETH ... price:0.00018800 buyp:0.00018838 sellp:0.00018894-bid:0.00018800 ask:0.00018963 m: Account has insufficient balance for requested action.

WeSpeakCrypto commented 6 years ago

Unfortunately no. It is not waiting. It got stuck due to the fact that it receives an error and the thread was terminated and did not return to the function that called it (sorry for speaking about codes). I'll try to study more about thread and try to prevent this.

Another known issue is that after it bought a coin. There is some server delay to binance. That if the program checks the order created. It returns m: UNKNOWN_ORDER. Thus receiving an error which cause it to got stuck again. Then you now have to sell your coin manually. But I didn't see this error for a while now. It seems binance fixed it already.

Memoi commented 6 years ago

Hi @WeSpeakCrypto, Thank you for this update. Just to know, if I want to disable stoploss I put --stop_loss 0 ?

Thanks

WeSpeakCrypto commented 6 years ago

Hi @Memoi --stop_loss argument is only for the percentage you want to decrease your original sell price. It didn't actually prevent the program to sell at market price.

This is a good point though. Do you want to hold the coin if --stop_loss 0 in case it didn't sell? Then bot will wait until that value is reached? Currently it holds for 10-11 seconds before selling at stop loss (sell price - (sell price * stop_loss / 100)) but if that is greater than the current ask price, it will sell at market price.

Memoi commented 6 years ago

Yes I prefer to hold until the sell price is reached.

kfiresmith commented 6 years ago

I would definitely prefer to hold until a future opportunity arises to sell at the target profit. Even if that point is hours or days in the future. That's basically all I'm looking for - a simple buy-low-sell-high bot.

WeSpeakCrypto commented 6 years ago

@Memoi @kfiresmith I'll try to modify later. Still figuring out how GitHub works. lol. @yasinkuyu Do I have to always fork (in order to get updated repo) before editing? Or is there some way to update my forked branch to the latest revision of the master branch (where fork came from)?