HUGE SCALE Backtest of Intraday Cryptocurrency Data using Python & SQL

In this video we are using Python and SQL to build up a DataBase containing the most granular historical price data from Binance, …


  1. we are iterating coin dataframes and assume we are taking position for every signal, how can we iterate all dataframes at once and go minute by minute?

  2. Love your videos, you've taken me from a noob at coding to fairly good in a year so I can't thank you enough! Just an idea for you: maybe do a back-test but include leveraged tokens/futures could be interesting?

    I ran through this back-test and made a few changes, adding the ability to short trading leveraged assets with x5 leverage. The returns were enough to absorb the commission but I'm sceptical it's too good to be true.

  3. Always good job, seriously:-) I'm study your video in this day for more concept of stock data, SQL maybe the best and is the "next level", it semmes Timescale DB offrer much power! Anyway it's my opinion just i want shared with you:-) Good jobs and very appreciate for you work:-)

  4. Does simply subtracting costs account for the fact trading fees reduce buying power over the backtest period? I feel like this is still overstating? Perhaps this is a log property? Would appriciate any insights or resources. Thanks!

  5. sorry for my stupid question, result show return n strategyreturn minus thats mean minus pnl?
    for example when i try bot, result like this:
    0.13615361536153614 0.006362609891987808 MASKUSDT -0.22031029619182219 -0.04366458060862563

    Its mean positif pnl for BLZUSDT,
    n minus pnl for MASKUSDT?

  6. Hello AlgoVibes, Im a big fan and have watched most your videos.

    Do you share the code anywhere for this,

    Im stuck at the part of building the DB and Im getting a lot of errors, do you happen to have a community chat anywhere. That would be super helpful, thanks for all your hard work

  7. Hi Algovibes!

    Firstly, thanks for the amazing content you're putting out. Its great to see a code focus and I absolutely love how you take the time to explain all the detail either here or in a previous video … much Kudos!

    My question is, how would you approach developing a backtesting algorithm if the sell condition depended upon the return of that particular trade. So for example lets say I wanted to buy at midnight every day, and then sell when the return of that trade was 1%. In a live trade this isn't too hard to keep track of, but how would you back test it when the sell relies on the return calculation which is then 'reset' after each trade. Also you could end up holding for 3 days or so which means the buys in the middle would not occur. Hopefully an interesting one for you!

  8. Nice Video! Shouldnt the cost be cost = (1-0.00075)^trades? Because if you e.g have 1000 dollars and take away 5 percent 2 times you have 1000*(1-5/100)*(1-5/100) = 1000* (1-5/100)^2

  9. Hello! I'm a beginner using the binance API and I'm getting stuck just trying to make a program access my binance account using the API keys. I wrote a test script of a trading strategy that takes live data and then prints buy, sell, wait to buy, or hold. If it decides to sell, it also prints the buy price. I got the program logic to function how I want it to, and now I want to actually connect it to my account and let it start to buy and sell crypto. However, for some reason, I keep getting an error that says either my API keys are wrong, my IP is invalid, or I don't have the required permissions. I've tried multiple API keys, my IP is unrestricted, and I gave the API permissions to do everything it should be able to do. I also get this message same message when I wrote a simple script just to view my basic account info. I'm not sure what I'm doing wrong, any help would be appreciated!

  10. Why does Binance return the time for the start of the candlestick and not the end of the candlestick?

    E.g. Closing price of '1m' candle of 18:59 timestamp is equal to the closing price of '15m' candle of 18:45 timestamp. (Hope this explanation does make sense).

    Is this done to be able to report unclosed candles, e.g. when the request happens in the middle of a '15m' candle, we still get some data from the last candle which has not closed yet?

  11. it's only matter of time until you get more subscribers, lots of small things gets repeated over the past videos and it gets more familiar. I love it!

  12. All your tutorials are LONG –> Buy & Sell. could you please help do a tutorial for short selling backtest? it would be intersting to see what profits can be made on certain strategy. thank you

  13. Hey buddy, i really respect you for your content and your type video with code. Can u share with me, which strategy in trading the best for 30-60 minutes trade with Machine learning, in your opinion?(sorry for my language, English isn’t my nativ language )

  14. Thanks for the valuable content.
    can we run this code 24/7 ? if so how we can do it ? do we need to host it in any server or git hub ?

  15. Very interesting video. Did you thought about trading futures. I wonder if the ability to go long or short with a certain leverage brings more or less profit compared to spotmarket. Maybe I will try it by my self. But I think binance's API is kind of crappy when it comes to futures.

  16. What I get from your videos usually is how data manipulation should be done properly. I tend to solve this problem the wrong way because I don't know how to use panda properly. I'm learning a lot thx. One question though, why didn't you do the download with multithreads? Wouldn't it had drastically cut the download and insert time?

  17. Hi, I have done some backtest with yfinance library, but when I tried it in real time with binancesocketmanager, it didn't work at all, I suppose that dellay causes too much price divergence (was doing trading on 1m scale) 🙁

  18. <There's no doubt in my mind that we are not only going bull, but BTC is going nuclear. A lot of people are wondering if now is a good time to buy because of where the price is at right now. I'd say it's outrightly wrong to just sit back hodl and wait maybe incur some losses along the line, that's a wrong mindset for an investor because as an investor finding ways to always increase and stack up more coins thereby making profiTs should be the way of lifeThat being said, the market is still all about BTC at the moment and I'll advise current investors and newbies to take advantage of Leon Calvin program, a pro trader who runs a training program for investors/ newbies who lack understanding on how trading Bitcoin works, to help them recover loss from the crash and also accumulate more bitcoin, with his program i went from having 3.8BTC to 12.8BTC in just 5 weeks.<You can reach him on TE LE GRAM >>>> @LeonCalvintrade.

Leave a Reply

Your email address will not be published.