Here is my implemented Python codes to compute VaR based on various models, max Sharpe ratio portfolio and dynamic allocation. The notebooks include simulated asset price with Monte Carlo and Constant Proportion Portfolio Insurance (CPPI) strategies.
The course is given by EDHEC Buisniess School on Cousera, with very clear coding session. Highly recommended!