Probability Of Profit, Options Strategy, Python Programming, Black Scholes Model.
(PoP) is %.2f%%" % (pop*100)) The final output is “Probability of Profit (PoP) is 37.60%”, which is self-explanatory, on your screen. The function get_d1_d2() follows: def get_d1_d2(s0,x,r,vol,time2maturity): d1=(log(s0/x)+(r+vol*vol/2.0)*time2maturity)/(vol*sqrt(time2maturity))