Altcoin [High Risk] Live Trading Bot with Python using the Binance API
E conheça também sobre o Melhor Bot Para Opções Binárias 2022
Que tal um robo gratuito para IQ Option? Sistema Para IQ Option Grátis
Thanks for watching 🙂
This video is showing how to construct an automated cryptocurrency trading bot which is making buying decisions based on the top performing Coin (over the last 24 h) on the whole Binance platform. These coins are most probably Altcoins and bear a huge amount of risk. Please really see this as an experiment.
Set up Binance API video and getminutedata function explained:
How the BinanceSocketManager works:
Getting the stream run outside Jupyter (in an IDE or raw python):
(around minute 9)
If you want to support me you can register for Binance with this link, but don’t feel forced to:
Disclaimer: This video is not an investment advice and is for educational and entertainment purposes only! Cryptocurrency and automated trading is bearing a high amount of risk which might result in a total loss of your invested capital.
00:00 – 01:36 Introduction / Strategy explanation / Disclaimer
01:36 – 02:22 Set up (libraries etc.)
02:22 – 05:50 Get skyrocketing cryptos: Filters
05:50 – 06:30 Struggling with parentheses (Skip this)
06:30 – 11:58 Get the top performing crypto
11:58 – 12:59 Get minute data for the top crypto
12:59 – 14:10 Trading dollar amounts with Binance
14:10 – 22:40 Strategy Option I: NOT using Socket Manager
22:40 – 23:30 Running the bot Option I
23:30 – 26:56 Strategy: Using the Socket Manager
26:56 – 27:35 Outcome of the first trade
27:35 – 28:53 Running the bot Option II
28:53 – 30:19 Some Trades the Bot made this morning
Vídeo
Hi everyone,
I made a slight mistake. Thanks a lot Abdul and Sevi for pointing that out!
When getting the top symbols you have to do a typecast to float as the values are provided as string values.
In the function right after defining all_pairs:
all_pairs['priceChangePercent'] = all_pairs['priceChangePercent'].astype(float)
Apologies for the inconveniences!
thank you for the informative video sir! please excuse me as I am fairly new to python programming. I tried your code using the socket option but nothing seems to happen. this is my code:
imports *
bsm = BinanceSocketManager(client)
def get_top_symbol():
~rest of the function here~
def getminutedata(symbol, interval, lookback):
~rest of the function here~
def createframe(msg):
~rest of the function here~
async def main():
async def strategy(buy_amt, SL=0.985, Target=1.02, open_position=False):
~rest of the function here~
if __name__=="__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
executing without using the socket works well but there will be limitations to the API with this method so I am hoping to implement the socket. thanks again sir! 🙂
Great video!
Thanks so much for you videos! I'm trying to add an additional screening function to this bot to remove illiquid coins (<250btc/24hrs z.b.) Any thoughts on how to implement that best?
Super Video!
Is it possible to build a telegram bot that notifies me of the positions( trades) of the top traders based on pnl on binance and ftx?
My program runs for a while but I get this error
KeyError: "None of [Index(['s', 'E', 'p'], dtype='object')] are in the [columns]
I keep getting precision errors I guess float casting is cutting off some of the price especially for a coin like SHIB which is 6 decimal places out
what's the difference using the Socket Manager and not using the Socket Manager. I was able to get it to work without using the Socket Manager on with raw python. the explanation on the other video (at around 9th minute) when you moved to other steps got confusing so I don't quite get how to execute it when using the socket manager
Broo help my scripts. Erorr
How can I try it with a virtual wallet? Have you already done it in another video? Great content!
great video mate, very informative! do you have any social media I can contact you on? just have a couple of questions regarding the bot
this is gold. thank you very much. but for dear love of God fking sake, STOP swalloing in the freaking mic man
APIError(code=-2010): Account has insufficient balance for requested action.
Im having some rounding problems with this code… Any tips?
You are just awesome bro. I am happy to have met with your channel.
Hey, thanks for the code, i am getting an error, how exactly should i solve this?
"await" allowed only within async functionPylance
(function) strategy_socket: (buy_amt, SL=0.985, Target=1.02, open_position=False) -> Any
This happens when calling the second option
that looks amazing :)! how do you think – can we use this in binance futures :D?
Would be awesome if you'd also do a quick summary with win / lose ratio at the end, because the PNL of the trades aren't obvious in the Trade History.
Much love for these kind of videos, where you show "skin in the game" instead of "just" backtesting. Keep it up! 🙂
When we calculate the ethereum qty , we want to buy 200 dollars, why does the qty show 0. How should we proceed to set a decimal amount?
hey, such a nice video. what editor you are using in this video? this live view looks cool. 🙂
My friend, you should get a patreon or something like that. Greetings from Wessermarch, Deutschland
Yo this is for the algo gods. interesting stuff
Hi, create_order function would not work for me because it said I had the wrong amount of parameters even though I copied this code exactly. I then used order_market_buy and order_market_sell functions instead of create_order. This worked, bought FORTHUSDT, printed the close, target & stop prices, but the program then crashed saying "None of [Index(['s', 'E', 'p'], dtype='object')] are in the [columns]" in regards to the createframe function. Do you have any idea why this is?
Gutes Video! Bist du Datascientist?
So, how's the balance now?
This was really good, How would you go about doing multiple altcoins in parallel?
You are always amazing , this type of video is just pure gem , thank you very much indeed
Don't we need to revert " open_position=False" right before the break of the "strategy" method?
Fantastic video- one question that is really puzzling me before going into this: are there any fees when you buy or sell a cryptos on binance ? I mean every time you pull a sell or buy order is it for free ?
Thanks.
Awesome video!
Do you know how to get the best performing asset of the priceChangePercent over the last 1 hour?
Hey. Great video. I would suggest to include volume as filter to exclude coins with low volume which mostly are quite new to the market and therefore can be risky.
Awesome video! It took me some trial and error, but I was able to get it to make a few purchases.
Is it possible to to create/run a bot on Binance futures? I can only see SPOT and Margin within the documention.
The way you fixed the connection closed issue was awesome, thanks for including that!
Great Video, simple strategy with potential, and excellent execution turning the idea into code.
впечатляет
Thank you for these explanations. I tested the bot in Live and it worked 🙂
On the other hand I used 60 dollars, and once it created an order, the bot returns an error :
BinanceAPIException: APIError(code=-2010): Account has insufficient balance for requested action.
My question: how to keep the bot in execution to sell the cryptos after buying the $60 (or other amount)?
Thanks 🙂
how to do to tell it to buy at -1 tick?
new subscriber for youu! If we do same things as you do, we have a trading bot?
hey love the content!! just getting started with python 🙂 how old are you?
Been watching a few of your recent videos and I love that you're explaining the code to help understand why you're doing it, been wanting to learn python for a long time and you've pushed me to do it, great content!
I have another pretty obvious question – were you able to make profit over time using these bots? what's preventing everyone from using something like this?
Great content again, thank you mate! Could I ask a favor, could you cover in your future videos how to get historical data for multiple coins? I am trying this but I am getting only SOLUSDT:
binance_symbols = ['BTCUSDT', 'ETHUSDT', 'XRPUSDT', 'SOLUSDT']
for symbol in binance_symbols:
new_df = pd.DataFrame(client.get_historical_klines(symbol, "1h", "1 Aug, 2022", "24 Sep, 2022"))
Thank you for sharing. I have one quick question. Is there any API that support live simulation trading the stock or cryptocurrency? I want to try what you did on my own but I'm not prepared enough to use real money so I want to know how to test strategy in live trading.(not backtest)