How to deploy a Cryptocurrency Trading Bot in the Cloud [GCP] using Python and Binance

If you find this useful or interesting, please consider subscribing and hit the like button. Thanks in advance 🙂 Get the …


  1. Hey algo, I'd love to thank you so much man following along with your videos and such and studying my quant degree Ive recently managed to get a job as a grad quant trader, it means so much to me man

  2. why do we need sql or csv? why cant we have a list of dataframes and keep appending the right price to the right symbol and automaticaly run calculations in pandas ? btw asking out of ignorance

  3. Thanks a lot for the awesome content ….perfectly well done!!

    I have a question and I hope you will have an advice or a solution for that:
    How can we deal with bots that has while loop (while True:)? As I noticed that crontab doesn't work with it , also I tried using @reboot in the crontab and it still doesn't work!

    Thank you in advance!

  4. Great content Algovibes, I have been experimenting a lot with your scripts, but about the cronjob in this one, I think a safer way, would be using a bash script that checks if the trading script is running, otherwise you could end up with too many instances. Something like: (

    if ! pgrep -x "" > /dev/null
    # run

    Although, I think it's better to change the quit() function with something else, removing the cronjob altogether.

  5. Thank you very much for this and all your other Python videos. Your projects are very interesting and provide an excellent framework for others to build from. I really enjoyed this one and your clear and concise explanation of it.

  6. hey, wouldn't it better to create the stop loss and take profit orders upfront after the limit order filled? if the price is moving very fast then we can have a quite a big loss.

  7. Hello question here. Im having connection error terminated by peer using binance api after few loops. I encapsulated with while try exception but it still stop with error after few loops.

  8. Thanks for the awesome work. I have a question. The code stops running after the first successful buy and sell in raw python. Is there a way to keep it running?

  9. Ahoi.
    Erst ein mal danke für die Videos. Extrem interessant. Ich bin totaler Anfänger und hatte mich jetzt etwas in python+sqlite eingearbeitet und nun aber gesehen, dass Du mittlerweile 'ne andere Variante bevorzugst.
    Wie wäre jetzt der empfohlene Fahrplan um erst mal alle Grundlagen zu bekommen? So nach dem Motto:
    1.python und api
    2. python und Datenbank……usw.
    Weil…wenn ich jetzt die Videos der Reihe nach durcharbeite, sind vielleicht einige Sachen nicht mehr aktuell und ich verschwende Zeit.
    Es wird ja sicher Gundthemen geben, die ich erst mal einzeln lernen kann, um dann Deinen Videos folgen zu können.
    Wie hast Du Dich eigentlich in das Thema eingearbeteitet? Bücher, Videos, Foren?
    Habe mir das Buch "Python for Finance" geholt und muss mal schauen, ob das geeignet ist. Die Technik ist ja doch sehr schnelllebig und das Buch ist von 2018.

  10. I'm running into this error:
    Lotsize = float([i for i in info['filters'] if i['filterType'] == 'LOT_SIZE'][0]['minQty'])
    TypeError: 'NoneType' object is not subscriptable
    Did I miss something?

  11. I need some help again 🙄😅 when i am in the linux instance and i am Creating a new py file it says: [1] Error und there are no files stored in my csvs :/
    Also when I am trying this code as you showed in the beginning the msg always changes sometimes from 67 outputs to 110…

  12. Hei,
    You are the best and the video was interesting but a short modification could be: symbol = [x for x in msg if (x['s'].endswith('USDT')

    and not (x['s'].__contains__('UP') | x['s'].__contains__('DOWN') | x['s'].__contains__('BULL') | x['s'].__contains__('BEAR')))]
    if you agree

  13. Very good content! I followed your channel on last Sunday, and I'm running my own bot now! I also found a timelag problem for price qry, so you solved it by transiting to web stream? Timelag keep draining my money even I found good deals…
    another question~ can you recommend GCP resource size to run trading bot 24/7?

  14. Another suggestion i can give you is to put gcp servers not in your country but in japan that is the closest to Binance servers; this way you can bring your request to binance quickier (0,30sec average for eu against 0,04 japan)

  15. bro i am doing the RSI calculation here

    def computeRSI (data, time_window):
    diff = np.diff(data)
    up_chg = 0 * diff
    down_chg = 0 * diff

    # up change is equal to the positive difference, otherwise equal to zero
    up_chg[diff > 0] = diff[ diff>0 ]

    # down change is equal to negative deifference, otherwise equal to zero
    down_chg[diff < 0] = diff[ diff < 0 ]

    up_chg = pd.DataFrame(up_chg)
    down_chg = pd.DataFrame(down_chg)

    up_chg_avg = up_chg.ewm(com=time_window-1 , min_periods=time_window).mean()
    down_chg_avg = down_chg.ewm(com=time_window-1 , min_periods=time_window).mean()

    rs = abs(up_chg_avg/down_chg_avg)
    rsi = 100 – (100/(1+rs))
    rsi = int(rsi[0].iloc[-1])
    return rsi

  16. frame = pd.DataFrame(symbol)[['E','s','c']]

    When you converted the symbol into dataframe the index of the goes along with it making a redudant column at the beginning when it is converted into CSV file. A better approach would be to remove that column using this piece of code

    def on_message(ws, message):
        msg    = json.loads(message)
        keys   = ['E','s','c']
        symbol = [list(map(x.get, keys)) for x in msg if (x['s'].endswith('USDT') and (not ('UP' in x['s'] or "DOWN"  in x['s'])) )]
        frame  = pd.DataFrame(symbol, index=None , columns=['E','s','c'] )
        frame.E = pd.to_datetime(frame.E, unit='ms')
        frame.c = frame.c.astype(float)
        for row in range(len(frame)):
            data = frame[row: row+1]
            data[['E','c']].to_csv(path+data['s'].values[0]+'.csv',mode='a', header = False, index=False)

  17. Hi i need some help so while i am converting string to float using last_df['free'] =last_df['free'].astype(float) there is a loss of precision after 6 digits from decimal point is there any way to fix this.

  18. Really good video. Thank you for sharing! I am trying to build my trading bot and your video help me a lot. One small question, once I implement the automatic running, do you know how to stop it? For example, if I would like to adjust the buy/sell trigger, I have to stop the bot and modify the code.

  19. Thank you so much for shareing your knowledge! In the new code, you didn´t remove the levarage tokens, and when i try to do it doesnt work. Is there something that im doing wrong or the new method is somehow incompatible?

  20. I'm tired… Youtube keeps removing my comments on your videos. I tired to repost 5 times and it removes everytime. Not the first time happening, and I have no idea why.

  21. While storing the data in the CSV file ".csv" should be added in the File path at the end so that it is actually stored as CSV file. If this is not done the data will be stored as FILE type. This code >> path+data['s'].values[0] should be changed as path+data['s'].values[0]+'.csv'

    data[['E','c']].to_csv(path+data['s'].values[0]+'.csv',mode='a', header = False)

  22. Hi Algo, off topic Here, how would the Margin trading work with python bot? Should i trade with only UP and Down coins and then just use Margin trading orders or is there another catch? Thank you

  23. I want to give bulk orders (abt 125) (direct market buy) with a certain amnt of money per unit, do u think is it possible? Thanks in advance

  24. can you give an example of How to implement the csv folder to empty it self after some time? im not the most experienced python programmer

Leave a Reply

Your email address will not be published.