Using ARIMA to Predict Bitcoin Prices in Python in 2023🔴

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 294

  • @adrianjaoszewski2631
    @adrianjaoszewski2631 Год назад +8

    The graph looks only so impressive because there are multiple models which only forecast one single value. The real deal is doing a relatively long forecast based on an ARIMA model. Twenty (or so) ARIMA Models each fitted on a subset of real data and forecasting only one step are exactly as useful as taking the last value and adding a random number to it.

  • @JarHen
    @JarHen 2 года назад +6

    I am happy there are people sharing passion with such preparation, congratulations on your great community support!

  • @antonismarinidis12
    @antonismarinidis12 2 года назад +9

    Really helpful tutorial. One question, when you try to predict future values that are not exist yet, what do you use at the part of
    actual_test_value = testing_set[i]
    training_set.append(actual_test_value)"
    because for the future we do not have "actual values". I used the model_predictions[i] as appending to the training_set (which actually the training_set is the actual whole data) and I get a straight line as a result at my graph which is not that good. any solutions? thank you in advance.

    • @dandeaton3601
      @dandeaton3601 2 года назад +1

      Same here … 😢

    • @junaidseedat7852
      @junaidseedat7852 Год назад +1

      same here...

    • @razimoosa7028
      @razimoosa7028 Год назад +1

      You might be getting a straight line because the model is predicting the price based on the same input features. Maybe for e.g. "you added input feature /actual value '200' to the data, the model will predict the price e.g. '250', now for next future day the input appended is same i.e. actual value '200' and hence model predicts again '250'. With this logic the model keeps on predicting '250' and you get a straight line as output. I believe you need to check the input features you're appending to the data set.

    • @SakshamGunj
      @SakshamGunj Год назад +1

      bro he is misguiding that's why he didn't replied to this comment.

  • @nangkhanh2546
    @nangkhanh2546 Год назад +1

    When running for loop, you add test data to training data and you run ARIMA model then the result absolutely great. However, it just like tell the computer learn by heart the data and tell it show the test data again

  • @narrrrdy
    @narrrrdy 2 года назад +1

    Very simple explanation to understand the application of ARIMA model. You da best.

  • @sagarpadhiyar3666
    @sagarpadhiyar3666 2 года назад +5

    Hey Ritvik, you haven't checked the stationarity and seasonality of the data or it is not necessary for price prediction? You have done prediction for test data. How do predictions for unseen data or future data? Do we have to run for loop for combined trained and test data for making predictions of unseen data?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +2

      Yes, Very good point. I didn't mention it as it might make the video more lengthy and confusing for beginners. But Yes, we will do all the relevant tests before performing the model in a real world analysis.

  • @optimalsolutionprogramming1299
    @optimalsolutionprogramming1299 Год назад +2

    Very helpful video! Thank you for posting.

  • @69nukeee
    @69nukeee Год назад +1

    Pretty good video! Thanks for sharing :)

  • @ibfaka1726
    @ibfaka1726 3 года назад +3

    Thanks once again for yet another captivating financial programming video. This is a video every crypto trader should watch to equip himself for financial gains.

  • @pisanchungchamroenkit7694
    @pisanchungchamroenkit7694 2 года назад +2

    Thank you Ritvik, easy to understand and very useful!!!

  • @Gio-ug3ye
    @Gio-ug3ye 2 года назад +1

    Subscribed! Thanks for the video :)

  • @BiffBifford
    @BiffBifford 3 года назад +6

    Ritvik, I wish you all the best for you and your family in the coming year and express my gratitude for your hard work and highly educational videos. Thank you from Rainy California, and best wishes!

  • @TheConconw
    @TheConconw 2 года назад +1

    Great vid! very helpful

  • @kevinlefebvre9838
    @kevinlefebvre9838 Год назад +1

    thank you for this great content. i am studying for CMT and this is very helpful, thanks!

  • @gatti_
    @gatti_ 3 года назад +1

    Nice work my friend!

  • @dwaipayansinha7697
    @dwaipayansinha7697 2 года назад +1

    Great, Thank you!

  • @dianimogadishu1348
    @dianimogadishu1348 2 года назад +1

    Great Channel. This is the channel I was looking for.

  • @somebodynobody2979
    @somebodynobody2979 Год назад +1

    Great video, thanks Ritvik

  • @yes-yogaearthstories1404
    @yes-yogaearthstories1404 2 года назад +1

    Ritvik, Great Work! :))) I had ARIMA during my BSc but obviously we never saw a computer so now i cna catch up.

  • @steknadel
    @steknadel 3 года назад +1

    Great Video, keep up the good work!

  • @mercykingori5661
    @mercykingori5661 2 года назад +1

    Excellent topic learned alot.

  • @thecomparefactory4601
    @thecomparefactory4601 3 года назад +3

    Great work buddy

  • @aashajawaharlal4855
    @aashajawaharlal4855 3 года назад +2

    Great work!

  • @harigovindp6061
    @harigovindp6061 2 года назад +1

    Loved the way you explained. It was really Helpful

  • @Vilas1972
    @Vilas1972 2 года назад +1

    thanks! learn so much

  • @m.shiqofilla4246
    @m.shiqofilla4246 2 года назад +2

    Sir thanks for the explanation, wanna ask one thing, can you plot the prediction of the stock price of the next 30 days? I mean not prediction in the test set, i want the prediction of the stock of the new days (next 30 days), is that possible to do? Thank you please answer it sir....

  • @carlolattanzi7878
    @carlolattanzi7878 2 года назад +1

    This is great! Thanks for your knowledge share! ;)

  • @vsanden
    @vsanden 2 года назад +1

    Thank you Ritvik, i liked the video a lot and found it usefull!

  • @iealpha-cqachallenge2897
    @iealpha-cqachallenge2897 3 года назад +2

    Nicely explained

  • @williamneri4299
    @williamneri4299 2 года назад +1

    Excellent topic I wish there was a similar video with Oil prices prediction using stock RSI or CCI indicators! Best of luck for this year

  • @akshitrana8446
    @akshitrana8446 2 года назад

    great content ! found your yt channel very useful

  • @BhumikaBhandari-x8x
    @BhumikaBhandari-x8x Год назад +1

    Which model is the best for time series predication? Is it LSTM, ARIMA or Prophet?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      It depends on the instrument we are predicting. Cryptos like Bitcoin will have a complete different answer than Bonds.

  • @aasthaarora9879
    @aasthaarora9879 2 года назад +1

    Great video , thanks for sharing knowledge

  • @gracesmith7726
    @gracesmith7726 3 года назад +1

    good explanation, thanks! waiting from one month... and video is delivered today keep it up ritvit

  • @mohammadkhan5387
    @mohammadkhan5387 Год назад +1

    with this arima model can we implement it into other asset classes? Of course, changing the Arima model or would this code automatically choose the best-fit Arima model for stock X?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +2

      Yes, it can be used for any tradable securities, however, it is just a basic model and might have some limitations. Please do thorough research before putting real money on it.

    • @mohammadkhan5387
      @mohammadkhan5387 Год назад +1

      @@FinancialProgrammingwithRitvik thanks for the reply much appreciated. I am a new follower of your RUclips account and I have seen many channels and I can say that you have some high quality content. I am a trader and currently doing my masters in finance from RMIT university Australia. But just learnt basic coding at uni with R studios. I can see you have a python course so if I take that course would I be able to make a model myself like the one you made like how advance is it what I mean to ask ? Thanks Mohammad khan

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      @@mohammadkhan5387 Thanks for your interest in my work. Yes, in that course you will learn to make the models on your own. In fact, sessions 4 and 5 are just about exploring some projects and how to optimize/automate them using Python. I guarantee you won't regret your decision to enrol for the course: fpritvik.com/python

  • @sarthakhajirnis1908
    @sarthakhajirnis1908 2 года назад +1

    You are doing such an amazing job. Waiting for your next videos eagerly! Thanks a lot.

  • @carters6138
    @carters6138 3 года назад +3

    Merry Christmas ❤️buddy

  • @camstuart
    @camstuart 2 года назад +3

    Great video, I was happy to subscribe! I did find that when running the statsmodel package suggests to change the import to: "from statsmodels.tsa.arima.model import ARIMA" (so arima.model instead of arima_model) but this causes some errors with the line 'yhat = list(output[0])[0]' when training. Do you mind having a look?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +2

      I will check it out and thanks for the sub

    • @matejmak9225
      @matejmak9225 2 года назад +1

      @@FinancialProgrammingwithRitvik Hello sir I have the same problem is there any solution for that ? Thank you for answear and excellent video :)

  • @bhupathireddy1663
    @bhupathireddy1663 Год назад +1

    is the data from yfinance reliable ? and if there are any other libraries like yfinance please do suggest.

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      Yes, pricing data is reliable as per my past experience, however, if you want to explore more financial data providers API, then I have made an entire playlist on it. Just check it out and you will see how much data is available in the market for free.

  • @suryadesings4486
    @suryadesings4486 2 года назад +1

    All the codes are soo easy to understand and execute

  • @ganpatipatil7551
    @ganpatipatil7551 10 месяцев назад

    Yes we want to see vedio on the ARIMA 👍

  • @burstingblahblah2313
    @burstingblahblah2313 3 года назад +1

    Cant wait to see the effect after params become optimized!

  • @machan2k6
    @machan2k6 2 года назад +1

    Good work Ritvik. your videos and codes are really helpful

  • @arunasrancevas6095
    @arunasrancevas6095 2 года назад +2

    If I iunderstand correctly the code makes a prediction for time already passed?? How can it make prediction for the future? Thanks, sir

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +1

      We need to incorporate more things in the model to make it for the real world

    • @arunasrancevas6095
      @arunasrancevas6095 2 года назад

      @@FinancialProgrammingwithRitvik I don't remember, does it predict one day into the future or not yet?

  • @jiahuizhou6521
    @jiahuizhou6521 2 года назад +1

    GOOd!

  • @flyhighdp
    @flyhighdp 2 года назад +1

    What is the use of lagged future prediction?

  • @MarioGiordano0
    @MarioGiordano0 2 года назад +1

    Fantastic job, i hope in some new contents soon!!!!

  • @dandeaton3601
    @dandeaton3601 2 года назад +1

    Amazing thank you so much! I notice that stats model has recently changed ARIMA, does it mean any code changes are required? I also couldn't work out how to amend the code to handle an MA value of > 0. I get error messages about convergence ...

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +2

      I would need to check it.

    • @dandeaton3601
      @dandeaton3601 2 года назад

      @@FinancialProgrammingwithRitvik I got it working ! But then began to wonder how useful my “creation” was in the real world … I.e I couldn’t forecast out multiple time intervals into the unknown as I wouldn’t be able to re-informing the training dataset each time :(

  • @oussamaaouini5489
    @oussamaaouini5489 2 года назад +1

    Your video is amazing

  • @mrvindictive2940
    @mrvindictive2940 2 года назад +1

    how do you increase the length of the model prediction so you are able to predict the price for the next day?

  • @Iyode
    @Iyode 2 года назад

    Thanks for sharing !

  • @visunashokkumar1782
    @visunashokkumar1782 2 года назад +1

    I would like to ask you sir how did your model account for the seasonality ?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +1

      Yes, Very good point. I didn't mention it as it might make the video more lengthy and confusing for beginners. But Yes, we will do all the relevant tests before performing the model in a real world analysis.

    • @omaraziz1299
      @omaraziz1299 Год назад

      seasonality in a time series = non-stationary data .... i think that is why he used differencing

  • @MrJuanazio
    @MrJuanazio 2 года назад +1

    Very interesting and complete explanation

  • @jeremyheath862
    @jeremyheath862 2 года назад +1

    Thanks for all your videos. They are very helpful. Keep up the great work, Ritvik!

  • @alexandr8153
    @alexandr8153 3 года назад +1

    Thanks for your video. Is there any way to get your code from your videos?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  3 года назад +1

      You can get a free access of my google drive. Over there, this code is save along with many other codes + study material.

  • @emilycherkassky3507
    @emilycherkassky3507 2 года назад +1

    Thanks!

  • @jedidiahdanley1605
    @jedidiahdanley1605 2 года назад

    love your coding style

  • @harikishorep7850
    @harikishorep7850 2 года назад

    Keep up the great work. Thanks for the video.

  • @YensyCiprianS
    @YensyCiprianS 2 года назад +1

    Is there any way to use this forecasting to analyze huge data and predict 5 or 15 min movements in a certain day? and if so, how can I do it, just to learn and compare with real market

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +2

      Prediction is possible, yet we would need to work on reliability on it. We can use the same model or any AI based models for the prediction.

  • @thefourluckyones889
    @thefourluckyones889 2 года назад +1

    how can i increase the lenght o the model prediction? like a prediction of a week instead of a day

  • @hamzapaskingakhtar
    @hamzapaskingakhtar Месяц назад

    Okay I am confused with one thing. We split data into train and test.
    Shouldn't we test the trained 90% on the final 10% not from the start?

  • @kgadrin844
    @kgadrin844 2 года назад

    Thank you for your content!

  • @巴塔-z5q
    @巴塔-z5q 2 года назад +1

    Genius

  • @pranitchand
    @pranitchand Год назад +1

    This is a good approach and I really enjoyed following it, however I am curious how would you account for non-stationary data in the forecast?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      Good question! I will make more videos covering nonstationarities.

    • @mohammadkhan5387
      @mohammadkhan5387 Год назад

      @@FinancialProgrammingwithRitvik i think you would convert that data into stationary then?

  • @senthilarumugam4913
    @senthilarumugam4913 2 года назад

    Good prediction analysis!

  • @varunkuntal9175
    @varunkuntal9175 2 года назад +1

    Thanks a lot for really helpful tutorial! I have a doubt as why are you training ARIMA model in a for loop for every iteration of test data. So if you are building a rolling model, it should be rather done every time new data point arrives, we can do train test split and train ARIMA model once instead of doing it for every iteration of test data.

  • @rameenaali
    @rameenaali 2 года назад

    Hi,Nice video.I would like to know more theoretical aspects of ARIMA.Please do a video if possible. Also can you do video on how to do CNN based prediction?

  • @BenMoussaFayssal
    @BenMoussaFayssal 8 месяцев назад +1

    Great video

  • @bhupathireddy1663
    @bhupathireddy1663 Год назад +1

    I am getting the predictions as a straight line no matter what values I take for p, d, q. Is it because of the stationarity of the data?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      Yes, we need to work on all biases before finalizing the code for real world applications such as Multicollinearity, Stationarity, heteroscedasticity, etc.

  • @leojulie8330
    @leojulie8330 2 года назад

    Thank you for providing all this useful content !

  • @himeshkoli8607
    @himeshkoli8607 2 года назад +1

    I have some doubts
    1) Dont we need to check if our data is stationary or not?
    2) And after if its not stationary we have to take differencing right
    3) And if at all it comes stationary we need to feed that value in plot acf and plot pacf to see our MA and AR values i.e p and q values
    4) Then we can come to conclusion of our p and q numbers right and then feed them to ARIMA model??
    So how did you land those 4,0,1 numbers, they cant be random
    Please correct/guide me if Im missing something
    I mean im confused is this video centered for bitcoin users or those guys who wants to know how that code is working?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +1

      No, you are correct. We would need to follow all the steps exactly as you mentioned in the real world analysis. I made the video just to show how we can use ARIMA model. Yes 4,0,1 should not be random. I appreciate your detailed comment :)

    • @himeshkoli8607
      @himeshkoli8607 2 года назад +1

      @@FinancialProgrammingwithRitvik thank you for clearing...
      I mean you can also make a detailed video regarding the points I mentioned, people will appreciate it, and also its nice to see different perspectives over a problem..
      Have a great day

    • @ajinkyaadhotre5336
      @ajinkyaadhotre5336 Год назад

      The same thought came to my mind why ain't he making the series stationary 😅

    • @omaraziz1299
      @omaraziz1299 Год назад

      it is good to check if data is stationary but with time series of financial instruments, the data is almost always non-stationary, especially as we expand the time period.

  • @laughtoutclips
    @laughtoutclips 2 года назад +2

    hello can u make a option trading simulator for Indian stock.. (Nifty50)

  • @ahmadlakunle9607
    @ahmadlakunle9607 2 года назад

    Thanks so much sir, this is straight forward
    Just a question please, what if I’m trying to pass multiple crypto asset instead of just bitcoin. Say 10 different assets how do i call it using yfinance?

  • @arunsandesh9503
    @arunsandesh9503 2 года назад

    Very well explained Sir. Thank you

  • @shireeshkumar6631
    @shireeshkumar6631 2 года назад +1

    Good content thank you

  • @majidtaghizadeh
    @majidtaghizadeh 2 года назад +1

    Ritvik You made my day - thank you

  • @maysaloumi7532
    @maysaloumi7532 2 года назад +1

    Thank u !

  • @shivamkashyap1877
    @shivamkashyap1877 5 месяцев назад

    Thank so much sir

  • @andregab6671
    @andregab6671 2 года назад +2

    thank you very much ritvik for your content that you bring to the channel and above all for the niche based on the markets and also for the clear and detailed explanations in the videos

  • @moto.argentina
    @moto.argentina Год назад +1

    I did everything as in the video but I have an error in yhat = list(output[0])[0] --> 'numpy.float64' object is not iterable

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      It's difficult to understand the query here. I recommend you to get the google drive access and copy and paste my code and check line by line where is the mistake.

    • @moto.argentina
      @moto.argentina Год назад

      @@FinancialProgrammingwithRitvik After many hours I was able to solve the error in this way yhat = output[0]

  • @aboudiallo5852
    @aboudiallo5852 2 года назад +1

    How to add the forcatested valeus at the same fugure with the actual values?

  • @vedanksingh6073
    @vedanksingh6073 2 года назад +1

    Is it a 1 day ahead prediction or what? Means the prediction is of what time spam?

  • @dicloniusN35
    @dicloniusN35 2 года назад +1

    what about Stationarity ? AIC tooo big, i think better to do auto_arima before, for choosing params

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  2 года назад +2

      Yes, Very good point. I didn't mention it as it might make the video more lengthy and confusing for beginners. But Yes, we will do all the relevant tests before performing the model in a real world analysis.

  • @SairamEslavath-k1m
    @SairamEslavath-k1m Год назад +1

    hello ritvik,
    can we able to take multiple columns to feed it

  • @omaraziz1299
    @omaraziz1299 Год назад

    Great video man, really appreciate it. One question though, how do I predict the value for the next trading day?

  • @AGhosh-sb8lf
    @AGhosh-sb8lf Год назад

    I can't understand the part where you have append the training data in the function with actual_test_value and how I can predict future price i.e. price after 1 week with this approach?

  • @desproscrypto2034
    @desproscrypto2034 2 года назад +1

    great video, can you try to predict forward testing

  • @VPAT37
    @VPAT37 2 года назад

    Thanks Ritvik for sharing. Great tutorials

  • @shivamkashyap1877
    @shivamkashyap1877 5 месяцев назад

    sir please upload videos for data how to used from different platform or others

  • @aapriyanka8323
    @aapriyanka8323 Год назад

    Hello sir. Thank you for your video. Excellent job. Could you please provide me the code to forecast future one year values. Please help me for my thesis

  • @dipakapate
    @dipakapate 2 года назад

    Ritvik sir. It's fantastic video. I am learning so much from you. I have developed my first intra day algo using python.

  • @ajays1031
    @ajays1031 2 года назад +1

    It is predicted future price or historical price ?

  • @mackkoranga1747
    @mackkoranga1747 2 года назад +1

    thank you : )

  • @carvajaltica7271
    @carvajaltica7271 2 года назад +1

    buen vídeo!!

  • @QuanttradingVega
    @QuanttradingVega 2 года назад +1

    great video !! can you please share details of instruments used while recording this great video

  • @antwanmingo257
    @antwanmingo257 2 года назад

    Ritvik, your videos are very easy to follow and extremely informational.

  • @urvashiarya8811
    @urvashiarya8811 Год назад +1

    hlo Sir goodevening
    I have been working on Nifty bank prediction using ARIMA in python since jan '23 . being from Commerce background everything seems a little bit difficult but i really want to do this . Now I am stuck at a point where I am getting straight line predictions . I don't know what to do . I have tried everything but all in vain. Please suggest me what to do next

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  Год назад +1

      It happens with everyone. Try some other model apart from ARIMA. You may like my fpProphet. I have made a video it that as well.

  • @34boy97
    @34boy97 Год назад +1

    I did a prediction of BTC and I got of mape of 0.18 did I made any mistake ?

  • @saadashraf1293
    @saadashraf1293 11 месяцев назад

    The prices till 2022 are already known, How can i use 100% of the data as training data and predict the future values??? Here we are prediciting already known values. How to predicit future values?

  • @alexandr8153
    @alexandr8153 3 года назад +1

    Is the code from your videos avaliable for downloading somewhere?

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  3 года назад +1

      You can get a free access of my google drive. Over there, this code is save along with many other codes + study material.