Help with Loop & BLS Price

Hi everyone,
Help would be greatly appreciated. I'm trying to calculate the Black Scholes price of a put and a call with varying increments of time and strike prices. I used for commands for both but when I execute the program, it only calculates the Call and Put price for the various instances of Time and only 1 strike price. Below is my code. Please help!!
for T=1:-0.05:0; S0=50; for K=30:0.5:70; r=0.03; sigma=0.4; [Call,Put]=blsprice(S0,K,r,T,sigma); T K end

1 件のコメント

Walter Roberson
Walter Roberson 2012 年 1 月 20 日
You have two "for" loops, but only one "end"

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

Tim
2012 年 1 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by