Modern Portfolio Theory PYTHON [Efficient Frontier Portfolio] 2020

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

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

  • @FinancialProgrammingwithRitvik
    @FinancialProgrammingwithRitvik  4 года назад

    𝐓𝐢𝐩 𝐦𝐞
    by:
    buying me a coffee in US Dollars: www.buymeacoffee.com/fpritvikusd
    buying me a coffee in Euros: www.buymeacoffee.com/fpritvik

  • @Julian-ph5jp
    @Julian-ph5jp 4 года назад +3

    Thanks for your work. u are one of the best channels in youtube

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

    I was really lost and was feeling really hopeless thenI found your channel thank you so much for doing this sir!

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

      Glad I could help! To get directly connected with me and discuss your projects with me and other like minded people, you may consider joining my Patreon Exclusive Community: www.patreon.com/fpritvik

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

    Good tutorial.. It would also be great if there was some explanation on how investors should use the efficient frontier for their personal portfolios

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

    This is really good gives inside to the potential of coding and provides base for new student of finance
    thank you for this initiative

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

    Do we can use efficient Frontier in real life scenario? if yes then How Can we take care of the assumption that returns are normally distributed? And if there is any other more effective way to find out optimum Risk return, considering returns are not normally distributed.

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

      You have a valid point. Returns are not normally distributed... they are negatively skewed. In order to solve this problem (at least partially), analysts use Black-Litterman model to incorporate manager's opinions as well.

    • @sanjaypandey6586
      @sanjaypandey6586 3 года назад

      Can we take returns data and convert it into normal Distribution and then use efficient frontier? Will it be more effective or won't work? And Thanks for replying 😊

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

    Could you please send me the graph of the calculated efficient frontier with its capital allocation line? Thank you

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

    amazing. thanks bro. it helps a lot. subscribed

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

    great job man, thank you for your content, it's so helpfull. though i couldnt find the drive link, can you please share it with me.

  • @fluxeyesopen
    @fluxeyesopen 4 года назад +2

    Hi Ritvik, a great tutorial, thankyou!
    Could a constraint be applied here that would return a frontier for only positive holdings (no shorts)?
    I'm assuming I'd have to join the Sharpe ratios to a DataFrame that sums the stock weights from WeightA and WeightB, and then eliminate rows with values

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

      Yes, it can be done. I will shortly make a video on the related topic.

    • @fluxeyesopen
      @fluxeyesopen 4 года назад

      @@FinancialProgrammingwithRitvik Much appreciated, thanks again!

  • @gjjangid
    @gjjangid 4 года назад +1

    bro your way of explaining things is awesome and loved your voice. Subscribed your channel also. Keep it up

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

    Hi, sorry for a kinda stupid question but could you explain what @ work in your code?

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

      It's not a stupid question as all. @ is used to do matrix multiplication. Suppose you have 2 matrices and want to do matrix/vector multiplication, then we use @. You remember MMULT function in Excel? It is exactly the same in Python. Please let me know if you understood. :)

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

    Can anybody give me the code of the last part that is CML, as I am a student of finance but learning python.
    Ritvik sir please make more such videos. Love it, thank you. 👍

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

    May I know on which basis should take the return and volatility while optimising five best risky portfolios asset from 10 companies....

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

      I couldn't understand your question. Could you please elaborate?

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

      @@FinancialProgrammingwithRitvik On finding the best optimisation of risky portfolio with respect to return and portfolio from 10 companies to 5 companies; on which basis should the 5 companies must be chosen as fit for best riskier optimisation asset sir..

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

      Thanks for your comment. Focus on Diversification of stocks :)

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

    May I get the link Or the reason for getting nan for the first value while returning log value...

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

      We get nan because we are dividing present day's price with last day price and for the first row there's no last day price available. To understand, you can try it on MS excel, it will throw a #NA there.

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

    Thank you

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

    No beatbox? Thanks for the video

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

    When we have more than 2 stocks in the portfolio, how to come with portfolio weights (with both positive and negative combinations)?
    let's say, 7 stocks and 5000 portfolio.

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

      I couldn't understand your questions. Could you please elaborate in detail, if possible?

    • @ekta9197
      @ekta9197 3 года назад

      @@FinancialProgrammingwithRitvik he asked a simple question that what if we have more than two stocks?

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

      @@ekta9197 I am a bit confused... I used more than 2 stocks to make the efficient frontier.

  • @swatityagi222
    @swatityagi222 4 года назад +1

    Why have you used 'Adj close' while reading data from the web?

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

      Interesting comment and a very good question. Swati, The closing price of a stock is the price of that stock at the close of the trading day. The adjusted closing price is a more complex analysis that uses the closing price as a starting point, but it takes into account factors such as dividends, stock splits, and new stock offerings to determine a value. Mostly, they are the same as other factors don't occur frequently.

    • @swatityagi222
      @swatityagi222 4 года назад +1

      @@FinancialProgrammingwithRitvik : Hey Ritvik, is it possible to get the ppt used in the video?

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

      @@swatityagi222 It's already present in my Google Drive. You can get a free access on my google drive by following steps mentioned on my RUclips Channel banner. But this service is only for my subscribers.

  • @kobodrago2758
    @kobodrago2758 4 года назад +1

    I get minus value for var... can u help?

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

      I guess you took profit/loss from the beginning and the negative value would be max loss possibility with 95.5% confidence.

  • @camfvc
    @camfvc 3 года назад

    Hi, congrats for your tutorials! I'm trying to do the cml but i can't...Can you help me?

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

      How can I help you?

    • @camfvc
      @camfvc 3 года назад

      @@FinancialProgrammingwithRitvik
      I am starting to program in python and so far I have done the portfolio in excel. I have difficulty programming the line and including it in the graph.

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

      @@camfvc I have uploaded the code in my Google drive. I recommend you to copy paste it and then run line by line to understand/decode the code. Let me know if it works for you.

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

      @@FinancialProgrammingwithRitvik
      I don't have access to your Google drive, I followed the link docs.google.com/forms/d/1if18SNBxegvkBUMri1YT01n8htGaKmrjkXyToTROLpg/viewform?edit_requested=true, and submitted it.

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

      Yes, I can see your google form response. Just provided the access to your email address. Can you access it now?

  • @7vrda7
    @7vrda7 3 года назад

    Shouldnt the returns formula be (c2-c1)/c1

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

      We can use this formula as well. It calculates absolute returns. On the other hand, I did logarithmic returns calculation.

  • @pfrazeto
    @pfrazeto 4 года назад

    Hi, I get a lot of errors and I have exactly replicated your code, but the blue word on your code when extracting the stock prices, doesnt appear blue to me, I think that the problem is there

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  4 года назад

      I understand, but sometimes we make some basic mistake and don't recognize. Have you got the access to my Google drive? If yes, then copy and paste my code in anaconda; run it there and then see what was the mistake in your code. 🙂

    • @joaoaug
      @joaoaug 4 года назад +1

      have you installed the pandas library? pip install pandas
      or conda install pandas

    • @FinancialProgrammingwithRitvik
      @FinancialProgrammingwithRitvik  4 года назад

      @@joaoaug pandas doesn't need installation. It's already there. Anyways, You may try pip install pandas.