CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.21k stars 303 forks source link

Config Parameters #93

Open Deweygattringer opened 2 years ago

Deweygattringer commented 2 years ago

Has anyone altered the config Parameters for tp SL Tsl ttp? If so, any Suggestions that worked Out for you so far? It seems the bot wont sell If Tsl is anything Other than 0...

Also Tried the latest Iteration... Syntax Error File fstring Line 1... Cant Seem to find it...

mypetkiwi commented 2 years ago

Certainly hard to dial this stuff in when we're only getting one hit per week or so, not sure how to do an accurate simulator though, given the weird Binance delay.

Deweygattringer commented 2 years ago

OK, todays announcement was bought again. And it Had the Chance for 28% win. BUT... It bought in an 38 usdt per pyr. It recalculated the ttp and Tsl multiple times even as the price dropped. Sold at roughly 36. Which is exactly the original -3% stoploss. I need to Take a Look but it seems the trailings are ALLWAYS recalculating for the latest price even If it Drops. Ie... In my opinion the trailing stoploss doesnt Work AS intended.. any ideas?

fabray1 commented 2 years ago

Hi Deweygattringer, Wow you managed to get a very good price with PYR! My bot bought it at 49.7$ which was exactly the peak of the pump... so in the end I just lost money :-(

Have you checked your logs? I think this trailing stop loss idea is great but I doubt the market conditions during the pump allow pulling a price precise enough to precisely track it. My TSL value was set to -4 and this is what I got last night:

2021-11-26 04:45:27,180 INFO: symbol='PYR'-last_price='50.185' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): 0.98%] 2021-11-26 04:45:27,442 INFO: symbol='PYR'-last_price='50.185' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): 0.98%] 2021-11-26 04:45:28,207 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:29,237 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:30,264 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:30,811 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:31,341 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:32,115 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:32,642 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:34,424 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:34,978 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:35,505 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:36,027 INFO: symbol='PYR'-last_price='47.914' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -3.59%] 2021-11-26 04:45:36,548 INFO: symbol='PYR'-last_price='38.933' [STOP: $48.20900 or -3.00%] [TOP: $50.69400 or 2.00%] [BUY: $49.70000 (+/-): -21.66%]

As you can see the price was stuck at -3.59% for 10 seconds, then collapsed in half a second to -21%. I know the fall was harsh but I cannot believe the price fell that much in half a second! At any rate the bot did sell, I suppose as soon as the loss passed 4% - but you are right I am also confused about the [STOP: $48.20900 or -3.00% : this is contradictory with the 'PYR'-last_price='47.914' and -3.59%

Still I don't believe it's safe: there will always be a risk that we buy too late (if the pump happened in less than 3 seconds!). I am going to change the code so that whenever the order's gone through I directly initiate sale orders at around +10% -> obviously less efficient but I believe the chances to make profit are superior.

Sorry for waffling :-)

Deweygattringer commented 2 years ago

That Sounds Like an interesting Idea? Have you Had troubles getting the Orders through? i had...Maybe you could Edit the Code so it Tries to buy at the given price Provided by gate.io plus 1 percent Like so? Dont know If this works but we will see

get latest price object

                obj = get_last_price(announcement_coin, globals.pairing, False)
                price = obj.price * 1.01
fabray1 commented 2 years ago

That was actually what I was doing in my original code, to make sure the order went through, but I have not had any issue getting the order through with this version of the code, just the fact that it went through at almost the peak of the pump.

Deweygattringer commented 2 years ago

Exactly. I figured because it is because i asks dir a Prince, as Soon as it knows the Price it tries to Buy. But in the meantime the Price is Higher so it rejects the Buy Order until peaked or almost peaked. I Hope this Change will best the rising Price by a Minimum amount of time

fabray1 commented 2 years ago

Again I don't think that's an issue: the order gets through, but the price it's getting it for is at the peak of the price pump. If what you're saying is true you should see a couple of buy orders attempts when the price is rising. Afaict I only see one buy order, when the price's reached its top. Same thing happened again with ALCX last night... :-( I believe we still receive the annoucenement too late.

Deweygattringer commented 2 years ago

OK, yes , i have Seen multiple buy Order attempts, returned with Status canceled. And a Buy Order Status closed near the Top. Anyhow... Now the webscraper stops for No good reason haha

ghost commented 2 years ago

I think we receive the announcement too late, this night for example I found: 02:59:34,349 INFO: New announcement detected: ALCX. However, at this moment, the curve is almost at the top

Deweygattringer commented 2 years ago

Hast anyone Else the Problem that the Listings scraper stops Wirkung after a few hours according to the logger Info?

shubhank-saxena commented 2 years ago

Hello. I am getting

  File "<fstring>", line 1
    (announcement_coin=)
                      ^
SyntaxError: invalid syntax

Not sure where

Deweygattringer commented 2 years ago

Had the Same issue. Updated to Python 3.9.. did the Trick For me

Linus045 commented 2 years ago

To fix the fstring error update to python 3.8+, see #114