├── static ├── macd │ ├── 83484_tpx_1_MACD.png │ └── 83484_tpx_2_MACD.png ├── acfpacf │ ├── 125435_0_Price.png │ ├── 125435_1_Price.png │ ├── 125435_2_Price.png │ ├── 125435_3_Price.png │ ├── 125435_4_Price.png │ ├── 125435_0_PriceACF.png │ ├── 125435_0_PricePACF.png │ ├── 125435_1_PriceACF.png │ ├── 125435_1_PricePACF.png │ ├── 125435_2_PriceACF.png │ ├── 125435_2_PricePACF.png │ ├── 125435_3_PriceACF.png │ ├── 125435_3_PricePACF.png │ ├── 125435_4_PriceACF.png │ └── 125435_4_PricePACF.png ├── analysis │ ├── 05678_05qqplot0.png │ ├── 05678_05qqplot1.png │ ├── 05678_05qqplot2.png │ ├── 05678_05qqplot3.png │ ├── 05678_05qqplot4.png │ ├── 60575_05qqplot0.png │ ├── 60575_05qqplot1.png │ ├── 60575_05qqplot2.png │ ├── 60575_05qqplot3.png │ ├── 05678_03Dailyreturns.png │ ├── 60575_03Dailyreturns.png │ ├── 60575_01portfolioweights.png │ ├── 60575_02adjclosingprices.png │ ├── 05678_04histogramLog Daily Returns Adj Close F.png │ ├── 05678_04histogramLog Daily Returns Adj Close FB.png │ ├── 05678_04histogramLog Daily Returns Adj Close GM.png │ ├── 05678_04histogramLog Daily Returns Adj Close IBM.png │ ├── 05678_04histogramLog Daily Returns Adj Close MDLZ.png │ ├── 05678_04histogramLog Daily Returns Adj Close NFLX.png │ ├── 05678_04histogramLog Daily Returns Adj Close RACE.png │ ├── 05678_04histogramLog Daily Returns Adj Close TSLA.png │ ├── 60575_04histogramLog Daily Returns Adj Close AAPL.png │ ├── 60575_04histogramLog Daily Returns Adj Close MSFT.png │ ├── 60575_04histogramLog Daily Returns Adj Close NFLX.png │ ├── 05678_04histogramLog Daily Returns Adj Close Portfolio.png │ └── 60575_04histogramLog Daily Returns Adj Close Portfolio.png ├── arimagarch │ ├── 39780_arimagarch0.png │ ├── 39780_arimagarch1.png │ ├── 39780_arimagarch2.png │ ├── 39780_arimagarch3.png │ └── 39780_01portfolioweights.png ├── candlesticks │ └── 39731_candlestick0.png ├── gbm_bootstrap │ ├── 12354_percentile0.png │ ├── 12354_percentile1.png │ ├── 12354_percentile2.png │ ├── 12354_percentile3.png │ ├── 12354_percentile4.png │ ├── 20026_percentile0.png │ ├── 20026_percentile1.png │ ├── 20026_percentile2.png │ ├── 20026_percentile3.png │ ├── 12354_totaliterations0.png │ ├── 12354_totaliterations1.png │ ├── 12354_totaliterations2.png │ ├── 12354_totaliterations3.png │ ├── 12354_totaliterations4.png │ ├── 20026_totaliterations0.png │ ├── 20026_totaliterations1.png │ ├── 20026_totaliterations2.png │ ├── 20026_totaliterations3.png │ ├── 12354_01portfolioweights.png │ └── 20026_01portfolioweights.png ├── holtwinters │ ├── 34031_0_TESForecast.png │ ├── 34031_1_TESForecast.png │ ├── 34031_2_TESForecast.png │ └── 34031_01portfolioweights.png ├── factoranalysis │ ├── 29417_01_Quartiles.png │ ├── 29417_02_CorrelByFactor.png │ └── 29417_03_CorrelOverall.png ├── vectorautoreg │ ├── 45004_AAPLVectorAR.png │ ├── 45004_MSFTVectorAR.png │ ├── 45004_NFLXVectorAR.png │ ├── 45004_01portfolioweights.png │ └── 45004_PortfolioVectorAR.png ├── bollingerbands │ └── 51901_bollingerband0.png ├── movingaverage │ ├── 99656_movingaverage_0.png │ ├── 99656_movingaverage_1.png │ └── 99656_01portfolioweights.png ├── efficientportfolio │ ├── 21318_efficientportfolio.png │ ├── 21318_01SharpePortfolioweights.png │ └── 21318_01SortinoPortfolioweights.png └── relativestrengthindex │ ├── 44122_0adjclosingprice.png │ ├── 44122_1adjclosingprice.png │ ├── 44122_2adjclosingprice.png │ ├── 44122_0relativestrengthindex.png │ ├── 44122_1relativestrengthindex.png │ └── 44122_2relativestrengthindex.png ├── requirements.txt ├── templates ├── results.html ├── resultsLogreturns.html ├── results_factoranalysis.html ├── resultsVecar.html ├── serverError.html └── index.html └── README.md /static/macd/83484_tpx_1_MACD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/macd/83484_tpx_1_MACD.png -------------------------------------------------------------------------------- /static/macd/83484_tpx_2_MACD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/macd/83484_tpx_2_MACD.png -------------------------------------------------------------------------------- /static/acfpacf/125435_0_Price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_0_Price.png -------------------------------------------------------------------------------- /static/acfpacf/125435_1_Price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_1_Price.png -------------------------------------------------------------------------------- /static/acfpacf/125435_2_Price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_2_Price.png -------------------------------------------------------------------------------- /static/acfpacf/125435_3_Price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_3_Price.png -------------------------------------------------------------------------------- /static/acfpacf/125435_4_Price.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_4_Price.png -------------------------------------------------------------------------------- /static/analysis/05678_05qqplot0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_05qqplot0.png -------------------------------------------------------------------------------- /static/analysis/05678_05qqplot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_05qqplot1.png -------------------------------------------------------------------------------- /static/analysis/05678_05qqplot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_05qqplot2.png -------------------------------------------------------------------------------- /static/analysis/05678_05qqplot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_05qqplot3.png -------------------------------------------------------------------------------- /static/analysis/05678_05qqplot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_05qqplot4.png -------------------------------------------------------------------------------- /static/analysis/60575_05qqplot0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_05qqplot0.png -------------------------------------------------------------------------------- /static/analysis/60575_05qqplot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_05qqplot1.png -------------------------------------------------------------------------------- /static/analysis/60575_05qqplot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_05qqplot2.png -------------------------------------------------------------------------------- /static/analysis/60575_05qqplot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_05qqplot3.png -------------------------------------------------------------------------------- /static/acfpacf/125435_0_PriceACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_0_PriceACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_0_PricePACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_0_PricePACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_1_PriceACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_1_PriceACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_1_PricePACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_1_PricePACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_2_PriceACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_2_PriceACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_2_PricePACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_2_PricePACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_3_PriceACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_3_PriceACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_3_PricePACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_3_PricePACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_4_PriceACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_4_PriceACF.png -------------------------------------------------------------------------------- /static/acfpacf/125435_4_PricePACF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/acfpacf/125435_4_PricePACF.png -------------------------------------------------------------------------------- /static/analysis/05678_03Dailyreturns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_03Dailyreturns.png -------------------------------------------------------------------------------- /static/analysis/60575_03Dailyreturns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_03Dailyreturns.png -------------------------------------------------------------------------------- /static/arimagarch/39780_arimagarch0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/arimagarch/39780_arimagarch0.png -------------------------------------------------------------------------------- /static/arimagarch/39780_arimagarch1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/arimagarch/39780_arimagarch1.png -------------------------------------------------------------------------------- /static/arimagarch/39780_arimagarch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/arimagarch/39780_arimagarch2.png -------------------------------------------------------------------------------- /static/arimagarch/39780_arimagarch3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/arimagarch/39780_arimagarch3.png -------------------------------------------------------------------------------- /static/candlesticks/39731_candlestick0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/candlesticks/39731_candlestick0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_percentile0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_percentile0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_percentile1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_percentile1.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_percentile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_percentile2.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_percentile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_percentile3.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_percentile4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_percentile4.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_percentile0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_percentile0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_percentile1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_percentile1.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_percentile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_percentile2.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_percentile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_percentile3.png -------------------------------------------------------------------------------- /static/holtwinters/34031_0_TESForecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/holtwinters/34031_0_TESForecast.png -------------------------------------------------------------------------------- /static/holtwinters/34031_1_TESForecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/holtwinters/34031_1_TESForecast.png -------------------------------------------------------------------------------- /static/holtwinters/34031_2_TESForecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/holtwinters/34031_2_TESForecast.png -------------------------------------------------------------------------------- /static/analysis/60575_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_01portfolioweights.png -------------------------------------------------------------------------------- /static/analysis/60575_02adjclosingprices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_02adjclosingprices.png -------------------------------------------------------------------------------- /static/factoranalysis/29417_01_Quartiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/factoranalysis/29417_01_Quartiles.png -------------------------------------------------------------------------------- /static/vectorautoreg/45004_AAPLVectorAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/vectorautoreg/45004_AAPLVectorAR.png -------------------------------------------------------------------------------- /static/vectorautoreg/45004_MSFTVectorAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/vectorautoreg/45004_MSFTVectorAR.png -------------------------------------------------------------------------------- /static/vectorautoreg/45004_NFLXVectorAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/vectorautoreg/45004_NFLXVectorAR.png -------------------------------------------------------------------------------- /static/arimagarch/39780_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/arimagarch/39780_01portfolioweights.png -------------------------------------------------------------------------------- /static/bollingerbands/51901_bollingerband0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/bollingerbands/51901_bollingerband0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_totaliterations0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_totaliterations0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_totaliterations1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_totaliterations1.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_totaliterations2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_totaliterations2.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_totaliterations3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_totaliterations3.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_totaliterations4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_totaliterations4.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_totaliterations0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_totaliterations0.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_totaliterations1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_totaliterations1.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_totaliterations2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_totaliterations2.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_totaliterations3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_totaliterations3.png -------------------------------------------------------------------------------- /static/holtwinters/34031_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/holtwinters/34031_01portfolioweights.png -------------------------------------------------------------------------------- /static/movingaverage/99656_movingaverage_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/movingaverage/99656_movingaverage_0.png -------------------------------------------------------------------------------- /static/movingaverage/99656_movingaverage_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/movingaverage/99656_movingaverage_1.png -------------------------------------------------------------------------------- /static/factoranalysis/29417_02_CorrelByFactor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/factoranalysis/29417_02_CorrelByFactor.png -------------------------------------------------------------------------------- /static/factoranalysis/29417_03_CorrelOverall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/factoranalysis/29417_03_CorrelOverall.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/12354_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/12354_01portfolioweights.png -------------------------------------------------------------------------------- /static/gbm_bootstrap/20026_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/gbm_bootstrap/20026_01portfolioweights.png -------------------------------------------------------------------------------- /static/movingaverage/99656_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/movingaverage/99656_01portfolioweights.png -------------------------------------------------------------------------------- /static/vectorautoreg/45004_01portfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/vectorautoreg/45004_01portfolioweights.png -------------------------------------------------------------------------------- /static/vectorautoreg/45004_PortfolioVectorAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/vectorautoreg/45004_PortfolioVectorAR.png -------------------------------------------------------------------------------- /static/efficientportfolio/21318_efficientportfolio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/efficientportfolio/21318_efficientportfolio.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_0adjclosingprice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_0adjclosingprice.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_1adjclosingprice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_1adjclosingprice.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_2adjclosingprice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_2adjclosingprice.png -------------------------------------------------------------------------------- /static/efficientportfolio/21318_01SharpePortfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/efficientportfolio/21318_01SharpePortfolioweights.png -------------------------------------------------------------------------------- /static/efficientportfolio/21318_01SortinoPortfolioweights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/efficientportfolio/21318_01SortinoPortfolioweights.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_0relativestrengthindex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_0relativestrengthindex.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_1relativestrengthindex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_1relativestrengthindex.png -------------------------------------------------------------------------------- /static/relativestrengthindex/44122_2relativestrengthindex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/relativestrengthindex/44122_2relativestrengthindex.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close F.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close FB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close FB.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close GM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close GM.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close IBM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close IBM.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close MDLZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close MDLZ.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close NFLX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close NFLX.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close RACE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close RACE.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close TSLA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close TSLA.png -------------------------------------------------------------------------------- /static/analysis/60575_04histogramLog Daily Returns Adj Close AAPL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_04histogramLog Daily Returns Adj Close AAPL.png -------------------------------------------------------------------------------- /static/analysis/60575_04histogramLog Daily Returns Adj Close MSFT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_04histogramLog Daily Returns Adj Close MSFT.png -------------------------------------------------------------------------------- /static/analysis/60575_04histogramLog Daily Returns Adj Close NFLX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_04histogramLog Daily Returns Adj Close NFLX.png -------------------------------------------------------------------------------- /static/analysis/05678_04histogramLog Daily Returns Adj Close Portfolio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/05678_04histogramLog Daily Returns Adj Close Portfolio.png -------------------------------------------------------------------------------- /static/analysis/60575_04histogramLog Daily Returns Adj Close Portfolio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhijingEu/StockSimulatorFlaskApp/HEAD/static/analysis/60575_04histogramLog Daily Returns Adj Close Portfolio.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | arch==4.15 2 | flask==1.1.2 3 | itsdangerous==1.1.0 4 | jinja2==2.11.2 5 | matplotlib==3.3.3 6 | numpy==1.19.2 7 | pandas==1.1.5 8 | pandas-datareader==0.9.0 9 | pillow==8.0.1 10 | pmda==0.3.0 11 | python-dateutil==2.8.1 12 | requests==2.25.1 13 | scikit-learn==0.23.2 14 | scipy==1.5.2 15 | statsmodels==0.12.1 16 | werkzeug==1.0.1 17 | 18 | -------------------------------------------------------------------------------- /templates/results.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Stock Price Simulator 8 | 9 | 10 | 11 | 12 | 13 | 14 |

{{analysistype}}

15 | 16 |

{{subheading}}

17 |

 

18 | 22 | {% for table in tableOne %} 23 | {{ table|safe }} 24 | {% endfor %} 25 |

 

26 | 27 | {% for hist in hists %} 28 | {{hist}} 29 | {% endfor %} 30 | 31 |

 

32 | 36 | {% for table in tableTwo %} 37 | {{ table|safe }} 38 | {% endfor %} 39 |

 

40 | 41 |

 

42 | 46 | {% for table in tableThree %} 47 | {{ table|safe }} 48 | {% endfor %} 49 |

 

50 | 51 |

 

52 | 56 | {% for table in tableFour %} 57 | {{ table|safe }} 58 | {% endfor %} 59 |

 

60 | 61 |

 

62 | 66 | {% for table in tableFive %} 67 | {{ table|safe }} 68 | {% endfor %} 69 |

 

70 | 71 |

 

72 | 76 | {% for table in tableSix %} 77 | {{ table|safe }} 78 | {% endfor %} 79 |

 

80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StockAnalysisWebApp 2 | This is a stock analysis Python Flask web app that allows you to forecast short term stock price movements using traditional statistical methods (e.g. ARIMA, HoltWinters and also GBM, etc) 3 | 4 | The full list of features are:- 5 | 6 | ...Analysis > Candlestick Chart 7 | 8 | ...Analysis > Log Daily Returns 9 | 10 | ...Analysis > Relative Strength Index Chart (RSI) 11 | 12 | ...Analysis > Moving Average Convergence Divergence (MACD) 13 | 14 | ...Analysis > Bollinger Bands Chart 15 | 16 | ...Analysis > Multi Factor Stock Screening & Ranking 17 | 18 | ...Forecast > Moving Average Forecast (Univariate) 19 | 20 | ...Forecast > Auto-ARIMA+GARCH Forecast (Univariate) 21 | 22 | ...Forecast > Auto-Holt Winters Forecast (Univariate) 23 | 24 | ...Forecast > Vector Auto Regression Forecast (Multivariate) 25 | 26 | ...Forecast > Geometric Brownian Motion (GBM) Forecast (Multivariate) 27 | 28 | ...Forecast > Bootstrap Sampling Forecast (Multivariate) 29 | 30 | ...Forecast > Portfolio Weights For Optimal Risk-Returns 31 | 32 | A working 'live' version of this app is hosted on Pythonanywhere https://www.stonksforecast.online 33 | 34 | Unless otherwise stated, all calculations reference the Adjusted Closing Prices which are extracted from Yahoo Finance through Python's PandasDataReader library and processed in the backend by a Python script. 35 | 36 | By default this web-app only plots and tabulates the last 60 "tail" values of any actual vs predicted stock prices. However the full table is available in the Jupyter Notebook iPYNB version of this file which is also in this repo 37 | 38 | Be aware that some selections need more time for the results to be calculated (E.g. Auto-Holt Winters , Efficient Portfolio Weights) 39 | 40 | The code used is a combination of original work and modified versions of code written by others (References directly listed in the flask_app.py file and also listed in the webapp itself) 41 | 42 | https://medium.com/swlh/generating-candlestick-charts-from-scratch-ef6e1d3cf0e9 43 | 44 | https://stackoverflow.com/questions/20526414/relative-strength-index-in-python-pandas 45 | 46 | https://tcoil.info/compute-bollinger-bands-for-stocks-with-python-and-pandas/ 47 | 48 | https://intellipaat.com/community/34075/numpy-version-of-exponential-weighted-moving-average-equivalent-to-pandas-ewm-mean/ 49 | 50 | https://medium.com/analytics-vidhya/arima-garch-forecasting-with-python-7a3f797de3ff 51 | 52 | https://machinelearningmastery.com/how-to-grid-search-triple-exponential-smoothing-for-time-series-forecasting-in-python/ 53 | 54 | https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python 55 | 56 | https://towardsdatascience.com/how-to-simulate-financial-portfolios-with-python-d0dc4b52a278 57 | 58 | Please Note: I am not a financial expert of any sort so the use of this tool for any investment decisions will be at your own risk ! 59 | -------------------------------------------------------------------------------- /templates/resultsLogreturns.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Stock Price Simulator 8 | 9 | 10 | 11 | 12 | 13 | 14 |

{{analysistype}}

15 | 16 |

{{subheading}}

17 |

 

18 | 22 | {% for table in tableOne %} 23 | {{ table|safe }} 24 | {% endfor %} 25 |

 

26 | 27 | {% for hist in hists %} 28 | {{hist}} 29 | {% endfor %} 30 | 31 |

 

32 |

Kolmogorov Smirnov For Normality

33 | 37 | {% for table in tableTwo %} 38 | {{ table|safe }} 39 | {% endfor %} 40 |

 

41 | 42 |

 

43 |

Skew-Kurtosis

44 | 48 | {% for table in tableThree %} 49 | {{ table|safe }} 50 | {% endfor %} 51 |

 

52 | 53 |

 

54 |

Correlation Matrix

55 | 58 | 62 | {% for table in tableFour %} 63 | {{ table|safe }} 64 | {% endfor %} 65 |

 

66 | 67 |

 

68 |

Augmented Dickey Fuller Test For Stationarity

69 | 73 | {% for table in tableFive %} 74 | {{ table|safe }} 75 | {% endfor %} 76 |

 

77 | 78 |

 

79 |

Comparison Of Mean/Standard Deviation Of Log Returns Across Start-Mid-End Of Historical Training Data

80 | 84 | {% for table in tableSix %} 85 | {{ table|safe }} 86 | {% endfor %} 87 |

 

88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /templates/results_factoranalysis.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Stock Price Simulator 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Factor Analysis

15 |
16 |

{{errorMessage}}

17 |

Normalisation Configuration

18 |

 

19 |

Normalisation Method: {{NormMethod}}

20 | 24 | {% for table in tableOne %} 25 | {{ table|safe }} 26 | {% endfor %} 27 |

 

28 | 29 |

Raw Un-Normalised Factors By Stock Counter

30 |

 

31 | 35 | {% for table in tableTwo %} 36 | {{ table|safe }} 37 | {% endfor %} 38 |

 

39 | 40 |

Note that {{missingCount}} Stocks Have Missing Data In At Least 1 Factor And Therefore Not Included In Scoring/Ranking Table

41 | 42 |

Ranked & Scored Stock Counters

43 |

NB Figures below reflect the normalised factors

44 |

 

45 | 49 | {% for table in tableThree %} 50 | {{ table|safe }} 51 | {% endfor %} 52 |

{{quartileMessage}}

53 |

 

54 | 55 |

Cronbach Alpha Score For Factors = {{cronbachalpha}}

56 | 57 |

Cronbach’s alpha is a convenient test used to estimate the reliability, or internal consistency, of a composite score

58 |

A negative number indicates that something is wrong with your data—perhaps you forgot to reverse score some items.

59 |

The general rule of thumb is that a Cronbach’s alpha of .70 and above is good, .80 and above is better, and .90 and above is best

60 | 61 | {% for hist in hists %} 62 | {{hist}} 63 | {% endfor %} 64 | 65 |

Correlation Of Normalized Factors vs Current (y.o.y) Annual Share Return

66 |

NB Figures below reflect the normalised factors

67 |

 

68 | 72 | {% for table in tableFour %} 73 | {{ table|safe }} 74 | {% endfor %} 75 |

 

76 | 77 |
78 | 79 |

Median Stock Returns By Ranked Quartiles

80 |

 

81 | 85 | {% for table in tableFive %} 86 | {{ table|safe }} 87 | {% endfor %} 88 |

 

89 | 90 |
91 | 92 |

List Of Top Quartile Stocks : {{ topQuartileListing|safe }}

93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /templates/resultsVecar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Stock Price Simulator 8 | 9 | 10 | 11 | 12 | 13 | 14 |

{{analysistype}}

15 | 16 |

{{subheading}}

17 |

 

18 | 22 | {% for table in tableOne %} 23 | {{ table|safe }} 24 | {% endfor %} 25 |

 

26 | 27 | {% for hist in hists %} 28 | {{hist}} 29 | {% endfor %} 30 | 31 |

 

32 | 36 | {% for table in tableTwo %} 37 | {{ table|safe }} 38 | {% endfor %} 39 |

 

40 | 41 |

 

42 |

GRANGER CAUSALITY TEST

43 | 48 | 52 | {% for table in tableThree %} 53 | {{ table|safe }} 54 | {% endfor %} 55 |

 

56 | 57 |

 

58 |

JOHANSON COINTEGRATION TEST

59 |

Estimated assuming no deterministic part for the order of time polynomial

60 | 64 | 68 | {% for table in tableFour %} 69 | {{ table|safe }} 70 | {% endfor %} 71 |

 

72 | 73 |

 

74 |

DURBIN WATSON TEST

75 | 79 | 83 | {% for table in tableFive %} 84 | {{ table|safe }} 85 | {% endfor %} 86 |

 

87 | 88 |

 

89 | 93 | {% for table in tableSix %} 94 | {{ table|safe }} 95 | {% endfor %} 96 |

 

97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /templates/serverError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Whoops 8 | 9 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

Internal Server Error

25 |

Sad Stonks Man

26 |

Image Source:https://sadmoneyblog.com/

27 |

 

28 |
29 |

Sorry :(

30 |

There's been an error of some sort...

31 | 32 |

Troubleshooting Common Errors

33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | 48 | 52 | 53 | 54 | 60 | 63 | 64 | 65 | 74 | 77 | 78 | 79 | 85 | 88 | 89 | 90 | 96 | 100 | 101 | 102 |
37 |

Errors

38 |
Troubleshooting Solution
43 |

pandas_datareader._utils.RemoteDataError:

44 |
    45 |
  • No data fetched for symbol sdf using YahooDailyReader
  • 46 |
47 |
49 |

Yahoo Finance may not have the stock price details

50 |

Check if the stock ticker name has been entered correctly by opening your browser and adding the relevant ticker to the end of this url https://finance.yahoo.com/quote/<TICKER>

51 |
55 |

ValueError:

56 |
    57 |
  • start must be an earlier date than end 
  • 58 |
59 |
61 |

Confirm that End Date is later than the Start Date

62 |
66 |

ValueError:

67 |
    68 |
  • Empty data passed with indices specified
  • 69 |
  • Prediction must have `end` after `start`
  • 70 |
  • Number of samples, -<Number>, must be non-negative
  • 71 |
  • Length mismatch: Expected axis has 0 elements, new values have <Number> elements
  • 72 |
73 |
75 |

Confirm that Forecast Date is later than End Date

76 |
80 |

ValueError:

81 |
    82 |
  • 'label' must be of length 'x'
  • 83 |
84 |
86 |

Confirm that Portfolio Weights match the No of stocks analysed and Portfolio Weights sum up to 100.0

87 |
91 |

IndexError:

92 |
    93 |
  • single positional indexer is out-of-bounds
  • 94 |
95 |
97 |

(Error is specific to Forecast > Auto-Holt Winters)

98 |

Ensure that Training Data (i.e Historical Start-End Date duration) contains AT LEAST 2 TIMES of what is specified as the Seasonality Period  

99 |
103 |

104 |

In addition, if you encounter unusual / very poor forecast results :- consider the following :-

105 | 115 |

116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Z's Stock Simulator 8 | 9 | 10 | 11 | 91 | 92 | 98 | 99 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |

Stock Price Simulator

115 |

Stonks | Know Your Meme

116 |

Image Source:Giphy.com

117 |

 

118 |

Hi ! I'm Z and this is a simple Stock Price Forecasting Web App that I built for fun using a combination of code from different online articles (sources listed below) and some of my own original code.

119 |

 

120 |

About This Web App

121 |

The web app allows you to analyze historical stock prices and also perform short term forecasts (~1-2wks) and compare results between different 'traditional' time series forecasting methods (ARIMA, Exponential Smoothing, etc) 

122 |

Pick an option from the list below and refer to the notes for more details

123 |

Unless otherwise stated, all calculations reference the Adjusted Closing Prices which are extracted from Yahoo Finance through Python's PandasDataReader library and processed in the backend by a Python script.

124 |

By default this web-app only plots and tabulates the last 60 "tail" values of any actual vs predicted stock prices. However the full table is available in the Jupyter Notebook iPYNB version of this file available on Github

125 |

Results will open up in a new tab to allow for easy comparison between different selections. 

126 |

Be aware that some selections need more time for the results to be calculated (E.g. Auto-Holt Winters , Efficient Portfolio Weights)

127 | 128 |

Please Note: I am not a financial expert of any sort so the use of this tool for any investment decisions will be at your own risk !  

129 |

 

130 | 131 |
132 | 133 |
134 | 152 |
153 | 154 |
155 | 156 |
157 | 158 |


159 |
160 | 161 |
162 | 163 |


164 |
165 | 166 |
167 | 168 |


169 |
170 | 171 |
172 |


173 |


174 |
175 | 176 |
177 |


178 |
179 | 180 |
181 |


182 |
183 | 184 |
185 |


186 |
187 | 188 |
189 |
193 |
194 | 195 |
196 |
197 |

198 |
199 | 200 |
201 |
202 |

203 |
204 | 205 |
206 |
207 |

208 |
209 | 210 |
211 |


212 |
213 | 214 |
215 |


216 |
217 | 218 |
219 |
224 |
225 | 226 |
227 |


228 |
229 | 230 |
231 |
235 |
236 | 237 |
238 |

Note - Please be patient as this needs about 1-2 minutes to run (1-2secs per stock)

239 |

Works best for ~30-50 counters

240 |

e.g. For a mix of 50 different SP500 Tech Stocks : AAPL, ACN, ADBE, ADSK, AKAM, AMD, AVGO, BR, CDW, CRM, CSCO, CTSH, CTXS, DXC, ENPH, FFIV, FIS, FISV, FLIR, FLT, FTNT, GLW, GPN, HPE, HPQ, IBM, INTC, INTU, IT, JNPR, MA, MCHP, MSFT, MSI, MU, NOW, NTAP, NVDA, ORCL, PYPL, QCOM, STX, SWKS, TER, TXN, V, VRSN, WU, XRX, ZBRA 241 |

242 | 243 | 251 | 252 |
253 |
254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 269 | 270 | 273 | 274 | 281 | 282 | 285 | 286 | 287 | 288 | 289 | 292 | 293 | 296 | 297 | 304 | 305 | 308 | 309 | 310 | 311 | 312 | 315 | 316 | 319 | 320 | 327 | 328 | 331 | 332 | 333 | 334 | 335 | 338 | 339 | 342 | 343 | 350 | 351 | 354 | 355 | 356 | 357 | 358 | 361 | 362 | 365 | 366 | 373 | 374 | 377 | 378 | 379 | 380 | 381 | 384 | 385 | 388 | 389 | 396 | 397 | 400 | 401 | 402 | 403 | 404 | 407 | 408 | 411 | 412 | 419 | 420 | 423 | 424 | 425 | 426 | 427 | 428 | 431 | 432 | 435 | 436 | 443 | 444 | 447 | 448 | 449 | 450 | 451 | 454 | 455 | 458 | 459 | 466 | 467 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 480 | 481 | 484 | 485 | 492 | 493 | 496 | 497 | 498 | 499 | 500 | 503 | 504 | 507 | 508 | 515 | 516 | 519 | 520 | 521 | 522 | 523 | 526 | 527 | 530 | 531 | 538 | 539 | 542 | 543 | 544 | 545 | 546 | 549 | 550 | 553 | 554 | 561 | 562 | 565 | 566 | 567 | 568 | 569 | 570 | 573 | 574 | 577 | 578 | 585 | 586 | 589 | 590 | 591 | 592 | 593 | 596 | 597 | 600 | 601 | 608 | 609 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 621 | 622 | 625 | 626 | 633 | 634 | 637 | 638 | 639 | 640 | 641 | 644 | 645 | 648 | 649 | 656 | 657 | 660 | 661 | 662 | 663 | 664 | 667 | 668 | 671 | 672 | 679 | 680 | 683 | 684 | 685 | 686 | 687 | 690 | 691 | 694 | 695 | 702 | 703 | 706 | 707 | 708 | 709 | 710 | 713 | 714 | 717 | 718 | 725 | 726 | 729 | 730 | 731 | 732 | 733 | 736 | 737 | 740 | 741 | 748 | 749 | 752 | 753 | 754 | 755 | 756 | 759 | 760 | 763 | 764 | 771 | 772 | 775 | 776 | 777 | 778 | 779 | 782 | 783 | 786 | 787 | 794 | 795 | 798 | 799 | 800 | 801 | 802 | 803 | 806 | 807 | 810 | 811 | 818 | 819 | 822 | 823 | 824 | 825 | 826 | 829 | 830 | 833 | 834 | 841 | 842 | 845 | 846 | 847 | 848 | 849 | 852 | 853 | 856 | 857 | 864 | 865 | 868 | 869 | 870 | 871 | 872 | 875 | 876 | 879 | 880 | 887 | 888 | 891 | 892 | 893 | 894 | 895 | 898 | 899 | 902 | 903 | 910 | 911 | 914 | 915 | 916 | 917 | 918 | 921 | 922 | 925 | 926 | 933 | 934 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 946 | 947 | 950 | 951 | 958 | 959 | 962 | 963 | 964 | 965 | 966 | 969 | 970 | 973 | 974 | 981 | 982 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 994 | 995 | 998 | 999 | 1006 | 1007 | 1010 | 1011 | 1012 | 1013 | 1014 | 1017 | 1018 | 1021 | 1022 | 1029 | 1030 | 1033 | 1034 | 1035 | 1036 | 1037 | 1040 | 1041 | 1044 | 1045 | 1052 | 1053 | 1056 | 1057 | 1058 | 1059 | 1060 | 1063 | 1064 | 1067 | 1068 | 1075 | 1076 | 1079 | 1080 | 1081 | 1082 | 1083 | 1086 | 1087 | 1090 | 1091 | 1098 | 1099 | 1102 | 1103 | 1104 | 1105 | 1106 | 1109 | 1110 | 1113 | 1114 | 1121 | 1122 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1134 | 1135 | 1138 | 1139 | 1146 | 1147 | 1150 | 1151 | 1152 | 1153 | 1154 | 1157 | 1158 | 1161 | 1162 | 1169 | 1170 | 1173 | 1174 | 1175 | 1176 | 1177 | 1180 | 1181 | 1184 | 1185 | 1192 | 1193 | 1196 | 1197 | 1198 | 1199 | 1200 | 1203 | 1204 | 1207 | 1208 | 1215 | 1216 | 1219 | 1220 | 1221 | 1222 | 1223 | 1226 | 1227 | 1230 | 1231 | 1238 | 1239 | 1242 | 1243 | 1244 | 1245 | 1246 | 1249 | 1250 | 1253 | 1254 | 1261 | 1262 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1274 | 1275 | 1278 | 1279 | 1286 | 1287 | 1290 | 1291 | 1292 | 1293 | 1294 | 1297 | 1298 | 1301 | 1302 | 1309 | 1310 | 1313 | 1314 | 1315 | 1316 | 1317 | 1320 | 1321 | 1324 | 1325 | 1332 | 1333 | 1336 | 1337 | 1338 | 1339 | 1340 | 1343 | 1344 | 1347 | 1348 | 1355 | 1356 | 1359 | 1360 | 1361 | 1362 | 1363 | 1366 | 1367 | 1370 | 1371 | 1378 | 1379 | 1382 | 1383 | 1384 | 1385 | 1386 | 1389 | 1390 | 1393 | 1394 | 1401 | 1402 | 1405 | 1406 | 1407 | 1408 | 1409 | 1412 | 1413 | 1416 | 1417 | 1424 | 1425 | 1428 | 1429 | 1430 | 1431 | 1432 | 1435 | 1436 | 1439 | 1440 | 1447 | 1448 | 1451 | 1452 | 1453 | 1454 | 1455 | 1458 | 1459 | 1462 | 1463 | 1470 | 1471 | 1474 | 1475 | 1476 | 1477 | 1478 | 1481 | 1482 | 1485 | 1486 | 1493 | 1494 | 1497 | 1498 | 1499 | 1500 | 1501 | 1502 |
DescriptionSelectChoose Hi/LoFactor Weight
Valuation Measures
267 | Market Cap (intraday) 268 | 271 | 272 | 275 | 280 | 283 | 284 |
290 | Enterprise Value 291 | 294 | 295 | 298 | 303 | 306 | 307 |
313 | Trailing P/E 314 | 317 | 318 | 321 | 326 | 329 | 330 |
336 | Forward P/E 337 | 340 | 341 | 344 | 349 | 352 | 353 |
359 | PEG Ratio (5 yr expected) 360 | 363 | 364 | 367 | 372 | 375 | 376 |
382 | Price/Sales (ttm) 383 | 386 | 387 | 390 | 395 | 398 | 399 |
405 | Price/Book (mrq) 406 | 409 | 410 | 413 | 418 | 421 | 422 |
429 | Enterprise Value/Revenue 430 | 433 | 434 | 437 | 442 | 445 | 446 |
452 | Enterprise Value/EBITDA 453 | 456 | 457 | 460 | 465 | 468 | 469 |
Financial Highlights
Fiscal Year
478 | Fiscal Year End Date 479 | 482 | 483 | 486 | 491 | 494 | 495 |
501 | Most Recent Quarter (mrq) Date 502 | 505 | 506 | 509 | 514 | 517 | 518 |
Profitability
524 | Profit Margin 525 | 528 | 529 | 532 | 537 | 540 | 541 |
547 | Operating Margin (ttm) 548 | 551 | 552 | 555 | 560 | 563 | 564 |
Management Effectiveness
571 | Return on Assets (ttm) 572 | 575 | 576 | 579 | 584 | 587 | 588 |
594 | Return on Equity (ttm) 595 | 598 | 599 | 602 | 607 | 610 | 611 |
Income Statement
619 | Revenue (ttm) 620 | 623 | 624 | 627 | 632 | 635 | 636 |
642 | Revenue Per Share (ttm) 643 | 646 | 647 | 650 | 655 | 658 | 659 |
665 | Quarterly Revenue Growth (yoy) 666 | 669 | 670 | 673 | 678 | 681 | 682 |
688 | Gross Profit (ttm) 689 | 692 | 693 | 696 | 701 | 704 | 705 |
711 | EBITDA 712 | 715 | 716 | 719 | 724 | 727 | 728 |
734 | Net Income Avi to Common (ttm) 735 | 738 | 739 | 742 | 747 | 750 | 751 |
757 | Diluted EPS (ttm) 758 | 761 | 762 | 765 | 770 | 773 | 774 |
780 | Quarterly Earnings Growth (yoy) 781 | 784 | 785 | 788 | 793 | 796 | 797 |
Balance Sheet
804 | Total Cash (mrq) 805 | 808 | 809 | 812 | 817 | 820 | 821 |
827 | Total Cash Per Share (mrq) 828 | 831 | 832 | 835 | 840 | 843 | 844 |
850 | Total Debt (mrq) 851 | 854 | 855 | 858 | 863 | 866 | 867 |
873 | Total Debt/Equity (mrq) 874 | 877 | 878 | 881 | 886 | 889 | 890 |
896 | Current Ratio (mrq) 897 | 900 | 901 | 904 | 909 | 912 | 913 |
919 | Book Value Per Share (mrq) 920 | 923 | 924 | 927 | 932 | 935 | 936 |
Cash Flow Statement
944 | Operating Cash Flow (ttm) 945 | 948 | 949 | 952 | 957 | 960 | 961 |
967 | Levered Free Cash Flow (ttm) 968 | 971 | 972 | 975 | 980 | 983 | 984 |
Stock Price History
992 | Beta (5Y Monthly) 993 | 996 | 997 | 1000 | 1005 | 1008 | 1009 |
1015 | 52-Week Change 1016 | 1019 | 1020 | 1023 | 1028 | 1031 | 1032 |
1038 | 52 Week High 1039 | 1042 | 1043 | 1046 | 1051 | 1054 | 1055 |
1061 | 52 Week Low 1062 | 1065 | 1066 | 1069 | 1074 | 1077 | 1078 |
1084 | 50-Day Moving Average 1085 | 1088 | 1089 | 1092 | 1097 | 1100 | 1101 |
1107 | 200-Day Moving Average 1108 | 1111 | 1112 | 1115 | 1120 | 1123 | 1124 |
Share Statistics
1132 | Avg Vol (3 month) 1133 | 1136 | 1137 | 1140 | 1145 | 1148 | 1149 |
1155 | Avg Vol (10 day) 1156 | 1159 | 1160 | 1163 | 1168 | 1171 | 1172 |
1178 | Shares Outstanding 1179 | 1182 | 1183 | 1186 | 1191 | 1194 | 1195 |
1201 | Float 1202 | 1205 | 1206 | 1209 | 1214 | 1217 | 1218 |
1224 | % Held by Insiders 1225 | 1228 | 1229 | 1232 | 1237 | 1240 | 1241 |
1247 | % Held by Institutions 1248 | 1251 | 1252 | 1255 | 1260 | 1263 | 1264 |
Dividends and Splits
1272 | Forward Annual Dividend Rate 1273 | 1276 | 1277 | 1280 | 1285 | 1288 | 1289 |
1295 | Forward Annual Dividend Yield 1296 | 1299 | 1300 | 1303 | 1308 | 1311 | 1312 |
1318 | Trailing Annual Dividend Rate 1319 | 1322 | 1323 | 1326 | 1331 | 1334 | 1335 |
1341 | Trailing Annual Dividend Yield 1342 | 1345 | 1346 | 1349 | 1354 | 1357 | 1358 |
1364 | 5 Year Average Dividend Yield 1365 | 1368 | 1369 | 1372 | 1377 | 1380 | 1381 |
1387 | Payout Ratio 1388 | 1391 | 1392 | 1395 | 1400 | 1403 | 1404 |
1410 | Dividend Date 1411 | 1414 | 1415 | 1418 | 1423 | 1426 | 1427 |
1433 | Ex-Dividend Date 1434 | 1437 | 1438 | 1441 | 1446 | 1449 | 1450 |
1456 | Last Split Factor 1457 | 1460 | 1461 | 1464 | 1469 | 1472 | 1473 |
1479 | Last Split Date 1480 | 1483 | 1484 | 1487 | 1492 | 1495 | 1496 |
1503 |
1504 | 1505 |
1506 |
1507 | 1508 |
1509 |
1510 | 1511 |
1512 |

 

1513 | 1514 | 1515 | 1516 | 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | 1523 | 1524 | 1525 | 1526 | 1527 | 1531 | 1532 | 1533 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
AnalysisCandlestick ChartsCandlestick charts show daily open, high, low, and close price and are used to determine possible price movement based on past patternsCandlestick Charting (Investopedia.com) 1528 |

Adapted from:

1529 |

https://medium.com/swlh/generating-candlestick-charts-from-scratch-ef6e1d3cf0e9

1530 |
1534 |

 

1535 | candlesticks 1536 |

Image Source:Quadency.com

1537 |
1538 | 1539 |
1540 |

 

1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | 1571 | 1580 | 1583 | 1584 | 1585 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
AnalysisLog Daily Returns Chart 1554 |

Log Returns are often used instead of simple returns to help normalize the underlying time series before applying other forecasting techniques.

1555 |

Log Returns=

1556 |

ln (Price(t+1)/Price(t))

1557 |

vs

1558 |

Simple Arithmetic Returns=

1559 |

[Price(t+1)-Price(t)]/ Price(t)

1560 |

1561 |

In addition, this option also :-

1562 |
    1563 |
  • plots the 'best fit' normal distribution for the log returns data
  • 1564 |
  • plots a Q-Q Chart for the log returns data
  • 1565 |
  • checks the skew and kurtosis  of the distribution;
  • 1566 |
  • checks if the mean & variance are constant by splitting the start / mid/ end of the training data and comparing them;
  • 1567 |
  • tests whether the distribution is normally distributed via KS Test;
  • 1568 |
  • tests whether the distribution is stationary via a ADF Test;
  • 1569 |
1570 |
1572 |

Why Log Returns ? (Quantivy Blog)

1573 |

1574 |

Komologorov Smirnov Test For Normality (Real-Statistics.com)

1575 |

1576 |

Augmented Dickey Fuller Test (StatisticsHowTo.com)

1577 |

1578 |

Q-Q Plots (StatisticsHowTo.com)

1579 |
1581 |

N/A - Original Content

1582 |
1586 |

 

1587 |

Skewness & Kurtosis (Source https://www.pinterest.com/pin/422281202809163/ )

1588 |

Skewness and kurtosis | Statistics math, Ap statistics, Statistics notes

1589 |

Q-Q Plot (Source https://stats.stackexchange.com/questions/101274/how-to-interpret-a-qq-plot )

1590 |

How to interpret a QQ plot - Cross Validated

1591 |

Examples Of Stationary vs Non Stationary Series (Source : https://stats.stackexchange.com/questions/182764/stationarity-tests-in-r-checking-mean-variance-and-covariance

1592 |

1593 |

 

1594 |

 

1595 |
1596 | 1597 |
1598 |

 

1599 | 1600 | 1601 | 1602 | 1603 | 1604 | 1605 | 1606 | 1607 | 1608 | 1609 | 1610 | 1611 | 1616 | 1617 | 1622 | 1623 | 1624 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
AnalysisRelative Strength Index Chart (RSI) 1612 |

RSI is a technical indicator that charts the current and historical strength or weakness of a stock based on the closing prices of a recent trading period.

1613 |

Values >70 indicate overbought shares and <30 indicates underbought shares

1614 |

Typically periods for RSI are set for 14 days and calculated using Simple Moving Averages SMA

1615 |
What Is RSI ? (Fidelity.com) 1618 |

Adapted From:

1619 |

https://stackoverflow.com/questions/20526414/relative-strength-index-in-python-pandas

1620 |

1621 |
1625 |

 

1626 | rsi 1627 |

Image Source:InvestorsUnderground.com

1628 |
1629 | 1630 | 1631 |
1632 |

 

1633 | 1634 | 1635 | 1636 | 1637 | 1638 | 1639 | 1640 | 1641 | 1642 | 1643 | 1644 | 1645 | 1649 | 1650 | 1653 | 1654 | 1655 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
AnalysisMoving Average Convergence Divergence (MACD) 1646 |

Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a stock price.

1647 |

The MACD is typically calculated by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA which is then smoothed over a 9-period EMA to generate a 'signal' line (i.e Set Periods 1,2,3 as 12,26,9 days respectively)

1648 |
What Is MACD ? (Fidelity.com) 1651 |

-NA-

1652 |
1656 |

 

1657 | macd 1658 |

Image Source:KLSEi3Investor.com

1659 |
1660 | 1661 |
1662 |

 

1663 | 1664 | 1665 | 1666 | 1667 | 1668 | 1669 | 1670 | 1671 | 1672 | 1673 | 1674 | 1675 | 1676 | 1677 | 1682 | 1683 | 1684 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
AnalysisBollinger Bands ChartBollinger Bands show a 'band' around  a simple moving average (SMA) of a stock price reflecting the standard deviations. Typical values are a smoothing period of 20days and standard deviation of 2What Are Bollinger Bands ? (Fidelity.com)  1678 |

Adapted From:

1679 |

https://tcoil.info/compute-bollinger-bands-for-stocks-with-python-and-pandas/

1680 |

1681 |
1685 |

 

1686 | rsi 1687 |

Image Source:TradingWithRayner.com

1688 |
1689 | 1690 |
1691 |

 

1692 | 1693 | 1694 | 1695 | 1696 | 1697 | 1698 | 1699 | 1700 | 1701 | 1702 | 1703 | 1704 | 1705 | 1706 | 1711 | 1712 | 1713 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
ForecastMoving Average Forecast (Univariate)Forecasts either a Simple Moving Average or Exponentially Weighted Average for a selected smoothing periodSMA and EMAs (SchoolStockCharts.com) 1707 |

Adapted From:

1708 |

Intellipaat.com

1709 |

1710 |
1714 |

 

1715 |

Comparison Exponential vs Simple Moving Averages

1716 |

(Source : https://medium.com/@ethan_johnson03/exploring-exponential-moving-average-56a3e89530c7)

1717 |

Exploring Exponential Moving Average | by Ethan Johnson | Medium

1718 |

Comparison of EMA vs SMA for 10 Day Period

1719 |

(Source: https://www.researchgate.net/figure/Comparison-of-moving-averages-The-SMA-has-more-lag-than-the-EMA_fig1_235766539

1720 |

Comparison of moving averages: The SMA has more lag than the EMA. 

1721 |
1722 | 1723 |
1724 | 1725 |
1726 |

 

1727 | 1728 | 1729 | 1730 | 1731 | 1732 | 1733 | 1734 | 1735 | 1736 | 1737 | 1738 | 1743 | 1748 | 1749 | 1753 | 1754 | 1755 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1739 |

Auto-ARIMA+GARCH Forecast

1740 |

(ARIMA= Auto Regressive Integrated Moving Average 

1741 |

GARCH = Generalised Auto Regressive Conditional Heteroskedasticity)

1742 |
1744 |

An (S)ARIMA model is used to model the log RETURNS (which is assumed to be stationary). The inputs for SARIMA i.e the (p,d,q,P,D,Q values) are AUTOMATICALLY set via pmdarima, a Python package, that optimizes for the config with the lowest AIC (Akaike information criterion)

1745 |

However since the volatility of the returns are likely to be non-constant  the GARCH(1,1) model is used improve forecasting performance

1746 |

Please be patient as algorithm needs ~1-2 min per stock to complete. 

1747 |
ARIMA GARCH Forecasting (Article from Medium.com) 1750 |

Adapted From:

1751 |

ARIMA GARCH Forecasting (Article from Medium.com)

1752 |
1756 |

 

1757 | 1758 |

The ARIMA model estimates the conditional mean (in the red box) where a subsequent GARCH model estimates the conditional variance present in the residuals of the ARIMA estimation (in the green box).

1759 |
1760 | 1761 |
1762 |

 

1763 | 1764 | 1765 | 1766 | 1767 | 1768 | 1769 | 1770 | 1771 | 1772 | 1773 | 1774 | 1778 | 1785 | 1786 | 1791 | 1792 | 1793 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1775 |

Auto Holt Winters

1776 |

Triple Exponential Smoothing

1777 |
1779 |

Fits a Triple Exponential Smoothing model against historical PRICES.

1780 |

Will 'brute-force' search all possible permutations for trend & seasonality type (additive vs multiplicative vs none) for a user provided seasonal period and select the configuration with the lowest RMSE for the training data.

1781 |

Typically, seasonality can be set at 252 days (~1 yr worth of trading days) or 5days (1 wk) 

1782 |

When selecting Start/End Date for historical training data, please note that this algorithm must have AT LEAST 2 seasonal periods for it to work.

1783 |

NOTE: Please be patient as algorithm needs ~3-4 min per stock to complete it's run  

1784 |
Holt Winters Forecasting For Dummies (https://grisha.org) 1787 |

Adapted From:

1788 |

How to Grid Search Triple Exponential Smoothing for Time Series Forecasting in Python

1789 |

(Machine Learning Mastery)

1790 |
1794 |

1795 |

mseas.fig1

1796 |

Source : https://kourentzes.com/forecasting/2014/11/09/additive-and-multiplicative-seasonality/ 

1797 |
1798 | 1799 |
1800 |

 

1801 | 1802 | 1803 | 1804 | 1805 | 1806 | 1807 | 1808 | 1809 | 1810 | 1811 | 1812 | 1815 | 1828 | 1837 | 1841 | 1842 | 1843 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1813 |

Vector Auto Regression Forecast (Multivariate)

1814 |
1816 |

Vector Auto Regression (VAR) is a MULTIVARIATE forecasting algorithm used when two or more time series influence each other. This forecast model applies VAR over the Log Returns data for multiple stocks.

1817 |

Unlike ARMA/ARIMA which are UNIVARIATE and 'one-directional',bVector Auto Regression (VAR) is bi-directional where each stock returns influence each other.

1818 |

The algorithm automatically selects the best Lag Order reflecting the auto-regressive relationship between the various different time series based on the lowest Aikake Information Criterion score.

1819 |

In addition, this option also returns a number of statistical tests to confirm the validity of the forecasting model:-

1820 |
    1821 |
  • Granger’s causality tests the null hypothesis that the coefficients of past values in the regression equation is zero.
  • 1822 |
  • Johanson's Cointegration test helps to establish the presence of a statistically significant connection between two or more time series
  • 1823 |
  • Durbin-Watson's test checks for any serial correlation of residuals (i.e if there is any leftover pattern in the residuals errors)
  • 1824 |
1825 |

1826 |

(Note - Use the Analysis > Log Returns to check the ADF Statistic as Vector Auto Regression requires stationary data)

1827 |
1829 |

Multivariate Time Series Forecasting (AnalyticsVidhya.com)

1830 |

1831 |

Granger's Causality Test (StatisticsHowTo.com)

1832 |

1833 |

Johansen's Cointegration Test (StatisticsHowTo.com)

1834 |

1835 |

Durbin-Watson Test (Investopedia.com)

1836 |
1838 |

Adapted From:

1839 |

https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python

1840 |
1844 |

1845 |
1846 | 1847 |
1848 |

 

1849 | 1850 | 1851 | 1852 | 1853 | 1854 | 1855 | 1856 | 1857 | 1858 | 1859 | 1860 | 1863 | 1868 | 1869 | 1873 | 1874 | 1875 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1861 |

Geometric Brownian Motion (GBM) Forecast (Multivariate)

1862 |
1864 |

Geometric Brownian Motion (GBM) models stock prices as a random walk with a constant drift accompanied by random shocks

1865 |

Assumes that the LOG RETURNS will then have a normal distribution where the mean and the variance of the LOG returns are estimated from the historical price data and assumed to be constant

1866 |

This function also works for MULTIVARIATE inputs as it will estimate the Covariance between Log Returns of different stocks and incorporate it into the 'random shock' component

1867 |
How To Use Monte Carlo Simulations With GBM (Investopedia.com) 1870 |

Adapted and modified from:

1871 |

https://towardsdatascience.com/how-to-simulate-financial-portfolios-with-python-d0dc4b52a278

1872 |
1876 |

1877 |

1878 |
1879 | 1880 |
1881 |

 

1882 | 1883 | 1884 | 1885 | 1886 | 1887 | 1888 | 1889 | 1890 | 1891 | 1892 | 1893 | 1896 | 1901 | 1902 | 1905 | 1906 | 1907 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1894 |

Bootstrap Forecast (Multivariate)

1895 |
1897 |

Similar to the GBM model, the Bootstrap Sampling forecast model assumes that future stock returns are random but can be estimated using the distribution of historical stock returns. 

1898 |

However unlike the GBM model, it does not require the Log Returns to be normally distributed and instead future prices are 'back-calculated' by sampling from historical returns and translating these back into absolute price values. 

1899 |

This function also works for MULTIVARIATE inputs as it samples 'sets' of returns from the same time slice thereby capturing correlation effects between stocks

1900 |
Stock Price Simulation Using Bootstrap and Monte Carlo (Scientific Annals of Economics and Business June 2017) 1903 |

-NA-

1904 |
1908 |

1909 |
1910 | 1911 |
1912 |

 

1913 | 1914 | 1915 | 1916 | 1917 | 1918 | 1919 | 1920 | 1921 | 1922 | 1923 | 1924 | 1927 | 1934 | 1941 | 1944 | 1945 | 1946 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1925 |

Portfolio Weights For Optimal Risk-Returns USING HISTORICAL RETURNS

1926 |
1928 |

 

1929 |

Modern Portfolio Theory assumes that there exists a set of optimal portfolios (Efficient Portfolios) that offer the highest expected return for a defined level of risk or the lowest risk for a given level of expected return

1930 |

This takes HISTORICAL returns data for a given start-end date and extracts the Std Deviation and Mean Log Returns for random combinations of stock weights using Monte Carlo Simulation and and plots them against each other.

1931 |

The Sharpe Ratio and Sortino Ratio for each stock weight configuration is tested to find the "optimal" weights with the best returns (Mean) for a given risk (standard deviation) 

1932 |

NOTE: Please be patient as the algorithm takes time to run e.g. ~1,000 iterations takes about 3-5 minutes

1933 |
1935 |

Efficient Frontier

1936 |

Mean Variance Portfolio Analysis

1937 |

Sortino Ratio

1938 |

Sharpe Ratio

1939 |

(Investopedia.com)

1940 |
1942 |

-NA-

1943 |
1947 |

 

1948 |

1949 |

Image Source:http://datascience.uconn.edu/index.php/projects/students-work/item/61-markowitz-portfolio-construction 

1950 |
1951 | 1952 |
1953 |

 

1954 | 1955 | 1956 | 1957 | 1958 | 1959 | 1960 | 1961 | 1962 | 1963 | 1964 | 1965 | 1968 | 1976 | 1983 | 1986 | 1987 | 1988 |
TypeTitleDescriptionMore Detailed ReferencesSource  Code 
Forecast 1966 |

Portfolio Weights For Optimal Risk-Returns Using FUTURE FORECAST RETURNS

1967 |
1969 |

 

1970 |

Similar to previous option that used HISTORICAL RETURNS with ONE KEY DIFFERENCE.

1971 |

Instead of HISTORICAL prices, the algorithm forecasts the P50 FUTURE returns using GBM or Bootstrap Sampling method for random combinations of stock weights are tested to plot the Std Deviation and Mean Log Returns using the same Monte Carlo Simulation.

1972 |

Note the no of iterations for the GBM or Bootstrap to estimate the P50 returns is FIXED to 10 iters to avoid time out - use the IPYNB version of the code if you want to experiment further

1973 |

The Sharpe Ratio and Sortino Ratio for each stock weight configuration is tested to find the "optimal" weights with the best returns (Mean) for a given risk (standard deviation) 

1974 |

NOTE: Please be patient as the algorithm takes time to run e.g. ~1,000 iterations takes about 3-5 minutes

1975 |
1977 |

Efficient Frontier

1978 |

Mean Variance Portfolio Analysis

1979 |

Sortino Ratio

1980 |

Sharpe Ratio

1981 |

(Investopedia.com)

1982 |
1984 |

-NA-

1985 |
1989 |

 

1990 |

1991 |

Image Source:http://datascience.uconn.edu/index.php/projects/students-work/item/61-markowitz-portfolio-construction 

1992 |
1993 | 1994 |
1995 |

 

1996 | 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2013 | 2014 | 2015 | 2016 | 2017 |
TypeTitleDescriptionMore Detailed ReferencesSource Code
AnalysisMulti Factor Ranking & Screening 2009 |

User makes a selection of relevant factors (key statistics from Yahoo Finance); a choice of factor weights ; normalization method (Z Score, Min-Max, Percentile) ; and aggregation type( Additive or Multiplicative.

2010 |

The code then calculates a composite score for each stock and ranks them to determine the "Top Quartile" stocks and compares them to the latest Annual y.o.y Stock Return 

2011 |

 

2012 |
Factor Investing (Source:Investopedia)Based on some original code hosted on the google colab here :
Colab Workbook
2018 |

 

2019 |

2020 |

2021 |

               

2022 |

 

2023 |
2024 | 2025 |
2026 |

2027 | 2028 |

Troubleshooting Common Errors

2029 | 2030 | 2031 | 2032 | 2035 | 2036 | 2037 | 2038 | 2044 | 2048 | 2049 | 2050 | 2056 | 2059 | 2060 | 2061 | 2070 | 2073 | 2074 | 2075 | 2081 | 2084 | 2085 | 2086 | 2092 | 2096 | 2097 | 2098 |
2033 |

Errors

2034 |
Troubleshooting Solution
2039 |

pandas_datareader._utils.RemoteDataError:

2040 |
    2041 |
  • No data fetched for symbol sdf using YahooDailyReader
  • 2042 |
2043 |
2045 |

Yahoo Finance may not have the stock price details

2046 |

Check if the stock ticker name has been entered correctly by opening your browser and adding the relevant ticker to the end of this url https://finance.yahoo.com/quote/<TICKER>

2047 |
2051 |

ValueError:

2052 |
    2053 |
  • start must be an earlier date than end 
  • 2054 |
2055 |
2057 |

Confirm that End Date is later than the Start Date

2058 |
2062 |

ValueError:

2063 |
    2064 |
  • Empty data passed with indices specified
  • 2065 |
  • Prediction must have `end` after `start`
  • 2066 |
  • Number of samples, -<Number>, must be non-negative
  • 2067 |
  • Length mismatch: Expected axis has 0 elements, new values have <Number> elements
  • 2068 |
2069 |
2071 |

Confirm that Forecast Date is later than End Date

2072 |
2076 |

ValueError:

2077 |
    2078 |
  • 'label' must be of length 'x'
  • 2079 |
2080 |
2082 |

Confirm that Portfolio Weights match the No of stocks analysed and Portfolio Weights sum up to 100.0

2083 |
2087 |

IndexError:

2088 |
    2089 |
  • single positional indexer is out-of-bounds
  • 2090 |
2091 |
2093 |

(Error is specific to Forecast > Auto-Holt Winters)

2094 |

Ensure that Training Data (i.e Historical Start-End Date duration) contains AT LEAST 2 TIMES of what is specified as the Seasonality Period  

2095 |
2099 |

2100 |

In addition, if you encounter unusual / very poor forecast results :- consider the following :-

2101 | 2111 |

2112 | 2113 |
2114 |

2115 |

About Me

2116 |

I'm Z (zhijingeu@yahoo.com) , an amateur Data Science enthusiast based in Asia Pac. 

2117 |

Connect With Me On LinkedIn: https://www.linkedin.com/in/eu-zhijing-25a4362 

2118 |

Read Some Of My Medium Articles: https://zhijingeu.medium.com/

2119 |

Visit My Github Page: GithubPage

2120 |
2121 |

Feedback 

2122 |

Like this site ? Let me know !

2123 |
2124 | 2125 | 2126 | 2127 | --------------------------------------------------------------------------------