Just finished Backtesting your strategy on 1 stock and already feel confident in deploying it? Imagine, the confidence (or rather arrogance) in Backtesting your strategy on the same stock OVER A 100 TIMES! But how is that even possible?! Let me show you…
Monte Carlo Simulation is a mathematical technique used to estimate the possible outcome of an uncertain event. The name comes from a city called Monte Carlo, which is known for gambling. It is a Randomly Evolving Simulation
Monte Carlo Simulations can help you with bettering your Backtesting results. Since, you can only Backtest over one historical run manually, you cannot hope to predict the future prices with it but, with Monte Carlo, you can create as many price simulations as you want.
It models the probability of different outcomes of a situation which are difficult to predict due to intervention of random variables. It works on the law of large number.
It uses random sampling which is a method used to produce multiple possible outcomes from random samples of data, and calculate the average result.
Monte Carlo is used in fields like Portfolio Management, which is run under multiple scenarios, to give the investors an idea of how their portfolio will perform under several market conditions. It is also used in risk analysis, option pricing and planning for spare capacity. It is not only used in finance but also in medicine and astrophysics
A simple procedure to run a Monte Carlo Simulation is as follows:
❇️ Set up a predictive model
❇️ Specify probability distribution
❇️ Run repeated simulations.
❇️ Calculate variance and standard deviation to analyse your data better
If the data is too big to run a simulation on. You can also use confidence levels which is the probability that the sampled results contain the true value of your parameter.
These simulations also help in exploring the Max Historical Drawdown. To put it simply, we get only a single drawdown value after Manual Backtesting. With Monte Carlo Simulations, you can create a Drawdown distribution which would give you a way better idea of what your strategy actually looks like in front of the real market forces.
The Python program attached below, demonstrates a very simple Monte Carlo Simulation over 3 stocks on a daily time frame over 252 days. The program uses Cholesky Decomposition to introduce a correlation structure to the assets in the portfolio. Test it out and have fun!
#quantitativefinance #quant #trading #algorithmictrading
Founder & Developer
9 mesiNon lo so, questi discorsi - secondo me - sono un po’ senza senso. Cioè cosa sono i fondamentali? Quando dice framework cosa intende? Cioè il framwork nasce per rispondere ad una esigenza. Magari anche alla stessa esigenza ma facendolo in maniera diversa - anche solo estetica - e queste diversità aiutano anche tutto l’ecosistema a cambiare e crescere. Il framework è una struttura. Ora il problema sta nel come vengono usati questi strumenti. Certo che se vogliamo usare un framework per fare “tutto” potrebbe essere una storpiatura di base. Inoltre anche i fondamentali cambiano, si evolvono per tanti motivi. E cambiano anche a seconda del contesto e per certi versi muoiono poiché sono pochi i casi di utlizzo. Penso nei design patterns come sia cambiato la frequenza di utilizzo. Chiaramente se intende quello come fondamentali.