Skip to content

Commit e68c4c8

Browse files
committed
Formatting
1 parent 90a6530 commit e68c4c8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

financetoolkit/options/options_controller.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -406,20 +406,20 @@ def get_binomial_model(
406406
407407
- up movement (u) = e^(σ * sqrt(t))
408408
- down movement (d) = 1 / u
409-
- risk neutral probability (p) = (e^((r - q) * t) - d) / (u - d)
410-
- stock price at each node = S * u^j * d^(n - j)
411-
- call option price at expiration date = max(S - K, 0)
412-
- put option price at expiration date = max(K - S, 0)
409+
- risk neutral probability (p) = (e^((r q) * t) d) / (u d)
410+
- stock price at each node = S * u^j * d^(n j)
411+
- call option price at expiration date = max(S K, 0)
412+
- put option price at expiration date = max(K S, 0)
413413
414414
For European Style options:
415415
416-
- call option price at each node = (p * C_u + (1 - p) * C_d) * e^(—r * t)
417-
- put option price at each node = (p * P_u + (1 - p) * P_d) * e^(—r * t)
416+
- call option price at each node = (p * C_u + (1 p) * C_d) * e^(—r * t)
417+
- put option price at each node = (p * P_u + (1 p) * P_d) * e^(—r * t)
418418
419419
For American Style options:
420420
421-
- call option price at each node = max(S - K, (p * C_u + (1 - p) * C_d) * e^(—r * t))
422-
- put option price at each node = max(K - S, (p * P_u + (1 - p) * P_d) * e^(—r * t))
421+
- call option price at each node = max(S K, (p * C_u + (1 p) * C_d) * e^(—r * t))
422+
- put option price at each node = max(K S, (p * P_u + (1 p) * P_d) * e^(—r * t))
423423
424424
Where S is the stock price, K is the strike price, r is the risk free rate, σ is the volatility, t is the time to
425425
expiration, j is the number of up movements, n is the number of time steps, C_u is the call option price at the up
@@ -615,7 +615,7 @@ def get_stock_price_simulation(
615615
616616
- up movement (u) = e^(σ * sqrt(t))
617617
- down movement (d) = 1 / u
618-
- stock price at each node = S * u^j * d^(n - j)
618+
- stock price at each node = S * u^j * d^(n j)
619619
620620
Where S is the stock price, r is the risk free rate, σ is the volatility, t is the time to
621621
expiration, j is the number of up movements, n is the number of time steps.

0 commit comments

Comments
 (0)