Pullback Trading Bot implemented in Python [SMA/Bollinger Bands/RSI] including Buy Limit Orders

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 136

  • @ventor11111
    @ventor11111 2 роки тому +2

    I build bots too. But in your video is always something new :)

    • @Algovibes
      @Algovibes  2 роки тому

      Awesome. Thanks a lot for watching and your comment!

  • @Christopher_Tron
    @Christopher_Tron 2 роки тому +3

    Empowering content! Much respect

    • @Algovibes
      @Algovibes  2 роки тому

      Thank you very much Christopher.

  • @stefandemerov8423
    @stefandemerov8423 2 роки тому +2

    Instead of calculating it yourself, I'm pretty sure you can pull price precision and quantity precision data from the Binance API for every pair you want to trade. On the other hand, that would put more unnecessary weight request on the API, too much weight and the Binance API starts refusing the queries. Also, great video, I've kinda given up trying to trade for profits, but I always learn so much Python from your videos, thanks!

    • @Algovibes
      @Algovibes  2 роки тому

      Hey man, that's awesome to read, thanks a lot. Pretty sure you actually can't but happy to be corrected!

  • @egey9482
    @egey9482 2 роки тому +1

    I am a metastock algo trader that wants to move into python. Thanks for the content.

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks :-) Be invited to check out my stuff then.

  • @theWSt
    @theWSt 2 роки тому +1

    Nice!! Yes please run the bot for some time, I'm very interested in the results! :-)

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks man! I will do so (with maybe 1-2 amendments).

  • @twentypt6872
    @twentypt6872 2 роки тому +9

    Always good content here thanks.
    for those who wants to round price and qty on futures you can do this:
    def get_symbol_info(symbol):
    info = client.futures_exchange_info()
    for item in info['symbols']:
    if(item['symbol'] == symbol):
    price_dec = item['pricePrecision']
    qty_dec = item['quantityPrecision']
    return price_dec, qty_dec
    price_precision = get_symbol_info(symbol)[0]
    qty_precision = get_symbol_info(symbol)[1]

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks mate, didn't verify that yet but thanks for sharing.

    • @twentypt6872
      @twentypt6872 2 роки тому +1

      @@Algovibes
      but I realized that some values ​​are not up to date, binance has a shitty api.
      Thanks to you, 2 months ago I didn't even know how to code, after coming across one of your videos and I got a taste for it and now I make my trading bot myself, thank you again

  • @user-il1hu5xp2x
    @user-il1hu5xp2x 2 роки тому +1

    thank you , Great content

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks for watching my friend :-)

  • @estebansantamaria8729
    @estebansantamaria8729 2 роки тому +1

    Thank you algo!! Great like always!

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks for watching and your support man!

  • @sammydk84
    @sammydk84 2 роки тому +2

    is that normal: Series([], name: symbol, dtype: object)
    and what else if I stop the script and start it again, it also shows what it bought

    • @Algovibes
      @Algovibes  2 роки тому

      Yea, just shows that you are currently not in a position.

    • @sammydk84
      @sammydk84 2 роки тому

      @@Algovibes i have send a emal

    • @wittyspecific7847
      @wittyspecific7847 2 роки тому

      @@sammydk84 did you get your problem fixed? and if yes what was the fault that caused it?

  • @walduss7939
    @walduss7939 2 роки тому +1

    Quick question.. if you are using only the last Row to check If buy or sell, why ejecute the conditions function to the entire data frame?
    Could be better to calculate it directly in the Trade function?
    I don’t know if I miss something else.

    • @Algovibes
      @Algovibes  2 роки тому

      Can you give me some timestamps where you are referring to? Helps me in providing faster and qualitative solutions. Thanks mate

  • @engenglish610
    @engenglish610 2 роки тому +1

    For security, this isn't running in Google colab? Which editor are you using?
    Thank you for the content 👍👍👍

    • @Algovibes
      @Algovibes  2 роки тому

      Didn't test it in Google collab. Using Jupyter here.

  • @cryzz0n
    @cryzz0n 2 роки тому +1

    Awesome content - Thank you so much!
    Quick question: In which video can I find info about how to set up the client?

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks buddy, just the first one in the cryptobot playlist

  • @bryan-9742
    @bryan-9742 2 роки тому +1

    Where is the video for the long term bot deployment? I'd love to check it out.

    • @Algovibes
      @Algovibes  2 роки тому

      I was posting the trading logs in the community tab some days/weeks later

  • @splendorman7922
    @splendorman7922 2 роки тому +1

    you dont need to work with floats. just use decimal module with quantize function.

    • @Algovibes
      @Algovibes  2 роки тому

      Would disagree on that but happy for an elaboration!

  • @henrykim8938
    @henrykim8938 2 роки тому +1

    Great video! I think you changed time frame from ‘day’ to ’minute’. Did you have any backtest result on this setup?

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks man. Yes, I did. No, not yet. Gotta let it run live in the upcoming weeks and either make a vid or a community post on the results.

  • @fredycoral
    @fredycoral 2 роки тому +1

    Excelent Bot ... thank you.

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks YOU for watching :-)

  • @GerardoIannace
    @GerardoIannace 2 роки тому +1

    awesome and nice explained

  • @hyungjoohnkim3065
    @hyungjoohnkim3065 2 роки тому +1

    Hello Mr.Algovibes. Thanks so much for your nice information.
    I have a question about web socket real-time data download from Binance and its calculation. After downloading the web socket data and I calculated them to be 1 minute (or 5 minutes) historical data, but my calculation is not the same with '1m' historical data(REST) from Binance. Can you recommend any good idea to resolve this issue?

    • @Algovibes
      @Algovibes  2 роки тому

      Hi mate :-)
      Do you consider the prices which have a true value for closed candles? The websocket contains "intracandle" data as well.

  • @wittyspecific7847
    @wittyspecific7847 2 роки тому +1

    it somehow doesnt open any trades at all - Series([], Name: symbol, dtype: object)
    thats the only message i get back

    • @Algovibes
      @Algovibes  2 роки тому

      If no buying conditions are fulfilled the bot won't buy anything. So this is not uncommon.

  • @remixland7768
    @remixland7768 2 роки тому +1

    great stuff !! Vielen Dank 👍

    • @Algovibes
      @Algovibes  2 роки тому

      Thx buddy :-)

    • @remixland7768
      @remixland7768 2 роки тому

      @@Algovibes i have problems with the lotsize of BTCUSDT, it returns 1e-05 , its not possible to calculate qty, how to fix that ? on the most pairs it works, i think it means 5 decimals

    • @remixland7768
      @remixland7768 2 роки тому

      Lotsize = [i for i in info['filters'] if i['filterType'] == 'LOT_SIZE'][0]['minQty']
      Lotsize = Decimal(Lotsize).normalize()
      this works, removed float conversion, and removing trailing zeros
      need import decimal
      from decimal import Decimal

  • @itayhilel2168
    @itayhilel2168 2 роки тому +1

    very entertaining!!

  • @santhoshdasari7
    @santhoshdasari7 2 роки тому +1

    Thanks a lot for sharing

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot for watching :-)

  • @vasusingh2894
    @vasusingh2894 2 роки тому +1

    Such a good content 😃

    • @Algovibes
      @Algovibes  2 роки тому +1

      Happy to read that man, thanks for watching! :-)

    • @vasusingh2894
      @vasusingh2894 2 роки тому

      @@Algovibes i click some adv 😅 is it ohk ?

  • @mandi4820
    @mandi4820 2 роки тому +1

    Hi, I'm trying to turn BitMex order book data into a data frame using the same method you used on binance
    When I run this code:
    orderbook = client.OrderBook.OrderBook_getL2(symbol='XBTUSD').result()
    orderbook_dataframe = pd.DataFrame(orderbook)
    I get this error:
    object of type RequestsResponseAdapter has no len()
    Any ideas?

    • @Algovibes
      @Algovibes  2 роки тому

      Yea, you need to make sure you can actually convert the orderbook into a dataframe. You need a dict or list datastructure. Now it seems to be a class/method.

  • @wittyspecific7847
    @wittyspecific7847 2 роки тому +1

    how do the conditions need to look so it creates a buy order based on the RSI?

    • @Algovibes
      @Algovibes  2 роки тому

      By taking a similar logic. I think I covered that in one of the previous videos. Be invited to check out the cryptobot playlist.

  • @alexcalish9774
    @alexcalish9774 2 роки тому +1

    Does anyone know why the RSI is calculated at 2 time steps? It seems the standard settings on Trading View would be 14 time steps. Thanks for the help.

    • @Algovibes
      @Algovibes  2 роки тому

      Hi Alex, i am simply taking the settings from the backtested strategy. I linked the video in the description (was some strategy from Rayner).

  • @muayda9675
    @muayda9675 2 роки тому +3

    Hello, thank you for the great content. I hope that you will do an educational course to create a complete trading bot in Python for the Binas platform and introduce more than one strategy. Thank you

    • @Algovibes
      @Algovibes  2 роки тому

      Hey Muayd,
      maybe somewhen in the future. If you want to support me financially (and also get access to the code) you should consider becoming a channel member:
      ua-cam.com/users/Algovibesjoin

  • @sammydk84
    @sammydk84 2 роки тому +1

    what if the market runs away?
    does he cancel the order and place it again or continue with it
    sorry for my bad english

    • @Algovibes
      @Algovibes  2 роки тому

      Order is pending as long as the price level is not triggered. You can add something like a cancelling time horizon (end of day, end of month,...) as an option.

  • @wittyspecific7847
    @wittyspecific7847 2 роки тому +1

    def conditions(df):
    df['Buy'] = np.where((df.Close < df.Lower) &
    (df.Close > df.SMA_200), 1,0)
    df['Sell'] = np.where((df.rsi > 50), 1,0)
    do you have suggestion for the values that i might can change for buying and selling order

    • @wittyspecific7847
      @wittyspecific7847 2 роки тому

      or how do i write the code that it buys below a rsi of 30? (df.Close > df.rsi, 1,0) - is that right?

    • @wittyspecific7847
      @wittyspecific7847 2 роки тому

      df.rsi < 30 i mean

    • @Algovibes
      @Algovibes  2 роки тому

      Hi mate, can you please check the other videos in the cryptobot playlist? Should be covered there. If you have any remaining question please feel free to reach out!

  • @Koslify
    @Koslify 2 роки тому +1

    can you make a video on executing trades on DEX exchange instead of binance? are there any libraries who solve DEX trade execution in Python?

    • @Algovibes
      @Algovibes  2 роки тому

      Good question and indeed an interesting topic. Didn't have any exposure to APIs on DEX yet.

  • @juanmiord
    @juanmiord 2 роки тому +1

    I may ask you for a coding strategy. How about a double/bottom top. I have checked it and it works fine with cryptocurrencies. A bot scanning a bunch of crypto when price going near a double top o double bottom. As an idea

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot for the suggestion juan!

  • @abdulmoiz5738
    @abdulmoiz5738 2 роки тому +2

    Hi, thanks man for such great content for free, I wanna know if you have any paid course on automated trading from beginner to advanced?

    • @AnotherAnon735
      @AnotherAnon735 2 роки тому +2

      He has videos on how to do everything, your course could just be watching them and making similar ones

    • @Algovibes
      @Algovibes  2 роки тому +1

      This is something I can imagine doing once I have slightly more time. I am currently pretty swamped. Until then there are a lot of free resources on my channel which you are invited to check out!

    • @armenovakov8053
      @armenovakov8053 2 роки тому

      @@AnotherAnon735 в

  • @amothe83
    @amothe83 2 роки тому +1

    Algovibes , any results on the perfomance of this bot?

    • @Algovibes
      @Algovibes  2 роки тому +1

      Didn't deploy it yet. Video was performing quite purely so I concluded no interest in that. But will keep you updated if I do so!

    • @wittyspecific7847
      @wittyspecific7847 2 роки тому

      @@Algovibes Please give us an update Algovibes

  • @reggiecheruryot1164
    @reggiecheruryot1164 2 роки тому +2

    You should do something with foreign exchange

    • @Algovibes
      @Algovibes  2 роки тому

      Thx for the suggestion. Already on my list but have to see when I am covering that.

  • @walduss7939
    @walduss7939 2 роки тому

    Hi Algovibes, I am trying to use this script to build an strategy. But I am struggling with my trigger condition.
    My buy condition should use few conditions. A). EMA cross, B) SlowEMA is increasing , but should be only one buy signal after the EMA Cross.
    Example: if when the EMACross, the SlowEMA is greater than previos SlowEMA, buy is trigger. Is SlowEMA is not greater, it waits until the first SlowEMA is greater than the previous one.
    Obviously, is EMACROSS In the other side, the condition is reset.
    In case buy condition is meet, and aferre that SL or TP is get. I need to wait until next crossEMA again
    Any clue how to approach it?
    Thanks in advance

    • @Algovibes
      @Algovibes  2 роки тому

      Hi Wal, thanks a lot for your comment.
      Well, hard to answer that with a comment. I have covered crossovers and stuff like that in previous videos. Maybe try to combine some of them.
      Or specify where exactly you struggle with, would be way easier to help then.

    • @walduss7939
      @walduss7939 2 роки тому

      @@Algovibes Hi, i have found another YT chanel that is using a direrent appoach, and it was usefull for me to solve the issue.
      if you dont mine, i could mention the UA-cam channel just in case other would like to checkit (even though, he hs mentioned you in one of his videos)

  • @amothe83
    @amothe83 2 роки тому +1

    How do I handle incomplete sells by the bot, probably the price went down before the bot completed the limit sell? thanks

    • @Algovibes
      @Algovibes  2 роки тому

      Can you provide an example when exactly this would happen?

    • @amothe83
      @amothe83 2 роки тому

      @@Algovibes Because we are using market order , in a situation where the price briefly reaches your sell price, but maybe the bid quantity was less than the amount you are selling, then the price goes down, you find that you have sold a fraction of your sells , maybe out of a quantity of 20 you have sold only 4. Then the print order is printed , and the bot goes on to look for another coin satisfying the condition. It has happened to my bots several times

  • @ventor11111
    @ventor11111 2 роки тому +2

    Do you know something about sending orders by websocket to Binance ? Is it possible now ?

  • @ahmadsolyman4219
    @ahmadsolyman4219 2 роки тому +2

    great video! please run and make a video about the results and backtesting

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks mate. Sure! Interested in that as well. I think I am going to do some more amendments tho before in the infrastructure.

  • @DaMemeLawd
    @DaMemeLawd 2 роки тому +2

    First, love your videos btw

  • @haythamelgharabway5225
    @haythamelgharabway5225 2 роки тому

    Hello Algo,
    thank you for the great content, keep it up :)
    i tried running the code but i think it doesnt work well with coins that have minqty 1 ... it does leave 1 digit after the decimal point while it shouldnot.
    great effort man 👍👍

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks mate,
      therefore I used the right_rounding function to cope with that. Can you give me an example coin where it doesn't work for you? Will have a look.

    • @affectreflect
      @affectreflect 2 роки тому

      @@Algovibes BTC

    • @affectreflect
      @affectreflect 2 роки тому

      @@Algovibes Thanks so much for sharing..!Really helpful for understanding the logic.Keep up!

    • @kemalselamicimen666
      @kemalselamicimen666 2 роки тому +1

      price function is wrong limit=0.98 because there are more floating numbers remove the limit and add the quantity calculation function in it as investment*0.999 it will work
      For buy limit orders, you should add timeInForce='GTC', inside the function

  • @matthewwilhelm563
    @matthewwilhelm563 2 роки тому +1

    Can I purchase this bot and pay installation and set-up fees?

    • @Algovibes
      @Algovibes  2 роки тому

      Hi Matthew,
      no, I don't offer that. Thanks for your understanding!

    • @matthewwilhelm563
      @matthewwilhelm563 2 роки тому

      @@Algovibes thank you for your time, do you happen to know where’s to look to purchase?

  • @its_code
    @its_code 2 роки тому +1

    Amazing 😍😄😍💕💕.

  • @imranhaseenkhan7115
    @imranhaseenkhan7115 2 роки тому

    How's Xec and vision tokens are..plz explain

  • @danielsckarin574
    @danielsckarin574 2 роки тому +1

    What are the backtest results?

    • @Algovibes
      @Algovibes  2 роки тому

      For a Backtest please check out the linked video in the description. I didn't test it on Cryptos yet tho!

  • @billn98
    @billn98 2 роки тому +1

    Thanks very much, you got some really informative videos. Can you please do a video on using NASDAQ and DOW as a leading indicator for Bitcoin market.

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks a lot Muhammad,
      can you elaborate on your suggestion?

    • @billn98
      @billn98 2 роки тому

      @@Algovibes I mean how high frequency market makers use order history on NASDAQ to create orders on binance. So, if NASDAQ is going up then they buy bitcoin, and if NASDAQ going down then they sell bitcoin. (Of course they might have additional logic too, but this is the idea.)

  • @ericsaare7373
    @ericsaare7373 2 роки тому +1

    I have joined as a member with access to code. How is the code obtained.

    • @Algovibes
      @Algovibes  2 роки тому

      Hi Eric,
      just write me a mail (you can find it in the about section).

    • @ericsaare7373
      @ericsaare7373 2 роки тому +1

      @@Algovibes what is email address

    • @Algovibes
      @Algovibes  2 роки тому

      @@ericsaare7373 Just check out the About section. You'll find it there.

    • @ericsaare7373
      @ericsaare7373 2 роки тому

      In the about section there only is a web address and no email. I am seeking code for your latest crypto trading bot

    • @Algovibes
      @Algovibes  2 роки тому

      @@ericsaare7373 businessalgovibes@gmail.com

  • @magicsmoke0
    @magicsmoke0 2 роки тому +1

    Have you actually used any of your bots in real money trading? How much was your principle and how long did you let your bot trade for? What is your ROI and over what timeframe?

    • @jempss.1162
      @jempss.1162 2 роки тому +2

      He answered other questions but not yours. Red flags. I got scammed with one of those bots before. DYOR

    • @Algovibes
      @Algovibes  2 роки тому +4

      These bot tutorials are tutorials and there is a crystal clear disclaimer before every video. I am letting certain bots run and usually post trading results in e.g. the community tab.
      I am trying my best to answer every comment - yet I cannot answer immediately.
      The goal of this channel isn't to sell trading strategies but to use different aspects of data related fields to design trading strategies.

  • @yusupswag
    @yusupswag 2 роки тому

    #pitbulltoken🐢🐢🐢

  • @sammydk84
    @sammydk84 2 роки тому

    code in google Drive ?

    • @Algovibes
      @Algovibes  2 роки тому +1

      Hi Sammy,
      yes. Will add it the upcoming days!

  • @estebansantamaria8729
    @estebansantamaria8729 2 роки тому

    Im running this bot for 2 weeks and it didnt buy nothing yet.. im starting to think that something is wrong... XD

    • @kemalselamicimen666
      @kemalselamicimen666 2 роки тому

      There is an error in the codes
      except:
      continue
      change =>
      finally:
      pass
      you can see the error code

    • @Algovibes
      @Algovibes  2 роки тому

      @@kemalselamicimen666 Did you double check that the coins were fulfilling the buying conditions within those two weeks?

    • @estebansantamaria8729
      @estebansantamaria8729 2 роки тому +1

      I already fixed it, as i modify a bit the code was totally my foult 😅 but thanks!

  • @shahbazahmedkhan2948
    @shahbazahmedkhan2948 2 роки тому +1

    Hello your video is very good. I have some problem I am unaware from Paython programming and Software can you help me that I learn to this type of code.

    • @Algovibes
      @Algovibes  2 роки тому

      Thanks mate!
      Sure, you can check out my Python Introduction and Python for Finance stuff afterwards. I got more then 100 videos which are happy to be checked out 😛

  • @morenocorvini
    @morenocorvini 2 роки тому +1

    DISLIKE

    • @Algovibes
      @Algovibes  2 роки тому +1

      What can I do to turn the thumb around?

  • @tvnaciparatriunfaro.r4061
    @tvnaciparatriunfaro.r4061 2 роки тому +1

    traducir al español

    • @Algovibes
      @Algovibes  2 роки тому

      Hmm..isn't it possible to activate like Spanish subtitles?

    • @estebansantamaria8729
      @estebansantamaria8729 2 роки тому +1

      Por que no aprendes tú ingles?

  • @fpeman
    @fpeman 2 роки тому +1

    '{:f}'.format(Lotsize) will fix the issue when doing BTCUSDT

    • @Algovibes
      @Algovibes  2 роки тому +1

      Unfortunately not 100% correct. Problem with that is you are ending up with a '0.000010' which string length exceeds the "real" Lotsize decimal length (6 instead of 5). I would just add a BTC condition to get rid of the problem.

  • @christianscheid1791
    @christianscheid1791 2 роки тому +1

    Awesome content - Thank you so much!
    Quick question: In which video can I find info about how to set up the client?

    • @Algovibes
      @Algovibes  2 роки тому +1

      Thanks mate.
      Pls check out the very first video in this playlist:
      ua-cam.com/play/PL9ATnizYJ7f8_opOpLnekEZNsNVUVbCZN.html