<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; font-family: \'Courier New\', Courier, monospace; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-size: 12px; line-height: 19px; text-align: left; \">저 과제 하다가 소스코드라고 이걸 찾았는데요 </ul>
   이걸 어딘가에 넣어서 실행시킬 수 있나요?-_-;

   계단식 계산을 해야 해서 하나 하나 하면 끝이 안보일거 같아요 ㅠㅠ
<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; font-family: \'Courier New\', Courier, monospace; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-size: 12px; line-height: 19px; text-align: left; \">
</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; font-family: \'Courier New\', Courier, monospace; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-size: 12px; line-height: 19px; text-align: left; \">
</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; font-family: \'Courier New\', Courier, monospace; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-size: 12px; line-height: 19px; text-align: left; \">
</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; font-family: \'Courier New\', Courier, monospace; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-size: 12px; line-height: 19px; text-align: left; \">tell application “Microsoft Excel”
activate worksheet “Sheet1″
set N_step_count to 1
set N_branch_count to 3
set N_node_count to 0

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set N to the text returned of (display dialog “enter the number of tree branches” default answer “5″) as integer
display dialog “Trinomial Step Count Set to ” & N</ul>

(* start node and bringing steps to +1*)

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Start_price to the text returned of (display dialog “Enter Start Price” default answer “5″) as number
display dialog “Start Price ” & Start_price</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Strike_price to the text returned of (display dialog “Enter Strike Price” default answer “5″) as number
display dialog “Strike Price ” & Strike_price</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Option_type to the text returned of (display dialog “Option type” default answer “Call”) as text
display dialog “Option type ” & Option_type</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Risk_free_rate to the text returned of (display dialog “Risk free rate” default answer “%”) as number
display dialog “Risk free rate ” & Risk_free_rate</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Security_yield to the text returned of (display dialog “Security yield” default answer “%”) as number
display dialog “Security yield ” & Security_yield</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Volatility to the text returned of (display dialog “Volatility” default answer “%”) as number
display dialog “Volatility ” & Volatility</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Time_to_maturity to the text returned of (display dialog “Days to Maturity” default answer “100″) as integer
display dialog “Days to Maturity ” & Time_to_maturity</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set trinomial_parameters to {“Trinomial Steps”, “Start_price”, “Strike_price”, “Option type”, “Risk free rate”, “Security yield”, “Volatility”, “Days to Maturity”}</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set trinomial_user_inputs to {N, Start_price, Strike_price, Option_type, (Risk_free_rate / 100), (Security_yield / 100), (Volatility / 100), Time_to_maturity}</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set trinomial_cell_reference to {“$B$1″, “$B$2″, “$B$3″, “$B$4″, “$B$5″, “$B$6″, “$B$7″, “$B$8″}</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set trinomial_variable to {“u”, “d”, “p(u)”, “p(d)”, “p(d)”}</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set trinomial_formulas to {“=EXP(” & (item 7 of trinomial_cell_reference) & “*((2*(” & (item 8 of trinomial_cell_reference) & “/365)/” & (item 1 of trinomial_cell_reference) & “)^(0.5)))”, ¬
“=1/EXP(” & (item 7 of trinomial_cell_reference) & “*((2*(” & (item 8 of trinomial_cell_reference) & “/365)/” & (item 1 of trinomial_cell_reference) & “)^(0.5)))”, ¬
“=((EXP((” & (item 5 of trinomial_cell_reference) & “-” & (item 6 of trinomial_cell_reference) & “)*(((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5)))-EXP(-” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))^0.5)))/(EXP(” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & N & “)*(0.5))^0.5))-EXP(-” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))^0.5))))^2″, ¬
“=((EXP(” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))^0.5))-EXP((” & (item 5 of trinomial_cell_reference) & “-” & (item 6 of trinomial_cell_reference) & “)*(((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))))/(EXP(” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))^0.5))-EXP(-” & (item 7 of trinomial_cell_reference) & “*((((” & (item 8 of trinomial_cell_reference) & “)/365/” & (item 1 of trinomial_cell_reference) & “)*(0.5))^0.5))))^2″, ¬
“=1-E3-E4″}</ul>

set row_counter to 1

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">repeat with i in trinomial_parameters

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set value of cell (get address of cell row_counter of column 1) of worksheet “Sheet1″ to (item row_counter of trinomial_parameters)
set value of cell (get address of cell row_counter of column 2) of worksheet “Sheet1″ to (item row_counter of trinomial_user_inputs)
set row_counter to row_counter + 1</ul>

end repeat

</ul>

set row_counter to 1

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">repeat with i in trinomial_variable

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set value of cell (get address of cell row_counter of column 4) of worksheet “Sheet1″ to (item row_counter of trinomial_variable)
set value of cell (get address of cell row_counter of column 5) of worksheet “Sheet1″ to (item row_counter of trinomial_formulas)
set row_counter to row_counter + 1</ul>

end repeat

</ul>

set N to N + 1

if Option_type = “Call” then

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Option_price to {“=MAX(” & (get value of cell (get address of cell 3 of column 5)) & “*”, ¬
“+” & (get value of cell (get address of cell 4 of column 5)) & “*”, ¬
“+” & (get value of cell (get address of cell 5 of column 5)) & “*”, ¬
“,”, ¬
“-” & Strike_price}</ul>

else

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set Option_price to {“=MAX(” & (get value of cell (get address of cell 3 of column 5)) & “*”, ¬
“+” & (get value of cell (get address of cell 4 of column 5)) & “*”, ¬
“+” & (get value of cell (get address of cell 5 of column 5)) & “*”, ¬
“,-”, ¬
“+” & Strike_price}</ul>

end if

repeat N times

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set value of cell (get address of cell (1 + (N) * 3) of column N_step_count) of worksheet “Sheet1″ to “=” & (item 2 of trinomial_cell_reference)
set value of cell (get address of cell (2 + (N) * 3) of column N_step_count) of worksheet “Sheet1″ to ¬
((get item 1 of Option_price) & (get address of cell ((N) * 3 – 1) of column (N_step_count + 2)) & ¬
(get item 2 of Option_price) & (get address of cell ((N) * 3 + 5) of column (N_step_count + 2)) & ¬
(get item 3 of Option_price) & (get address of cell (2 + (N) * 3) of column (N_step_count + 2)) & ¬
(get item 4 of Option_price) & (get address of cell (1 + (N) * 3) of column N_step_count) & ¬
(get item 5 of Option_price))</ul><ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; background-color: rgb(238, 238, 238); list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">repeat N_node_count times

<ul class=\"code\" style=\"padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 1em; margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em; list-style-image: url(http://www.24-something.com/wp-content/themes/mistylook/img/bullet.png); \">set value of cell (get address of cell (1 + (N) * 3 – (N_branch_count)) of column N_step_count) of worksheet “Sheet1″ to ¬
“=” & ((get address of cell ((N) * 3 – (N_branch_count) + 4) of column (N_step_count – 2))) ¬
& “*” & ¬
((get address of cell 1 of column 5))
set value of cell (get address of cell (2 + (N) * 3 – (N_branch_count)) of column N_step_count) of worksheet “Sheet1″ to ¬
((get item 1 of Option_price) & (get address of cell ((N) * 3 – (N_branch_count) – 1) of column (N_step_count + 2)) & ¬
(get item 2 of Option_price) & (get address of cell ((N) * 3 – (N_branch_count) + 5) of column (N_step_count + 2)) & ¬
(get item 3 of Option_price) & (get address of cell (2 + (N) * 3 – (N_branch_count)) of column (N_step_count + 2)) & ¬
(get item 4 of Option_price) & (get address of cell (1 + (N) * 3 – (N_branch_count)) of column N_step_count) & ¬
(get item 5 of Option_price))
set value of cell (get address of cell (1 + (N) * 3 + (N_branch_count)) of column N_step_count) of worksheet “Sheet1″ to ¬
“=” & ((get address of cell ((N) * 3 + (N_branch_count) – 2) of column (N_step_count – 2))) ¬
& “*” & ¬
((get address of cell 2 of column 5))
set value of cell (get address of cell (2 + (N) * 3 + (N_branch_count)) of column N_step_count) of worksheet “Sheet1″ to ¬
((get item 1 of Option_price) & (get address of cell ((N) * 3 + (N_branch_count) – 1) of column (N_step_count + 2)) & ¬
(get item 2 of Option_price) & (get address of cell ((N) * 3 + (N_branch_count) + 5) of column (N_step_count + 2)) & ¬
(get item 3 of Option_price) & (get address of cell (2 + (N) * 3 + (N_branch_count)) of column (N_step_count + 2)) & ¬
(get item 4 of Option_price) & (get address of cell (1 + (N) * 3 + (N_branch_count)) of column N_step_count) & ¬
(get item 5 of Option_price))
set N_branch_count to N_branch_count + 3
end repeat</ul>

set N_branch_count to 3
set N_step_count to N_step_count + 2
set N_node_count to N_node_count + 1

</ul>

end repeat
end tell

</ul>