Trading Profit Loss Diagram and Simple Trading Probabilities
Part 1. Trader Performance
--
Quick and easy calculation for profit loss of your trades over time using Python. Track your performance in trading with these simple distributions and probabilities of your trades.
Part 2. Stock Market Data
Some basic mean reversion problability calculations to get you started using the $SPY ETF. If and how you use it is up to you to figure out.
Prerequisites
pip3 install pandas
pip3 install matplotlib
pip3 install yfinance
pip3 install numpy
pip3 install pandas
pip3 install scipy
pip3 install seaborn
Part 1. Trader Performance
The Data
For we use the trader’s data the input report.csv
format is as follows of all the trades made:
CloseTime,Instrument,Profit/Loss
DD/MM/YYYY,USA 500, 00000.00
DD/MM/YYYY,USA 500, -00000.00
The Result
Results for profit_loss.py shows all the trades over time.
profit_loss_distributions.py shows a normal bell curve of all the trader’s trades. Most of my trades are immediately stopped out just below $0.
trader_prob_of_profit.py shows the odds of a trader being profitable on a trade. I am a profitable trader with 143% yoy and yet in stark contrast my odds of profit on a single trade are 30:70. More importantly, I split these odds into six categories. While I am doing significantly better on larger trades, I am significantly underperforming on smaller trades, and that is where I need to improve. This could best be remedied by moving my stop-loss orders just above breakeven, rather than just below.
Prob of profit: 29.411764705882355 Prob of loss: 70.27863777089783