SQLIVPremiumCSharpSPs.sql cs хранимые процедуры

  1.  
  2. --- deleting --
  3. /*
  4.  
  5. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  6. drop procedure BS_CDELTA01
  7. GO
  8. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  9. drop procedure BS_CDELTA02
  10. GO
  11. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  12. drop procedure BS_CDELTA03
  13. GO
  14. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  15. drop procedure BS_CDELTA04
  16. GO
  17.  
  18. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  19. drop procedure BS_PDELTA01
  20. GO
  21. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  22. drop procedure BS_PDELTA02
  23. GO
  24. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  25. drop procedure BS_PDELTA03
  26. GO
  27. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  28. drop procedure BS_PDELTA04
  29. GO
  30.  
  31. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  32. drop procedure BS_CTHETA01
  33. GO
  34. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  35. drop procedure BS_CTHETA02
  36. GO
  37. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  38. drop procedure BS_CTHETA03
  39. GO
  40. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  41. drop procedure BS_CTHETA04
  42. GO
  43.  
  44. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  45. drop procedure BS_PTHETA01
  46. GO
  47. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  48. drop procedure BS_PTHETA02
  49. GO
  50. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  51. drop procedure BS_PTHETA03
  52. GO
  53. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  54. drop procedure BS_PTHETA04
  55. GO
  56.  
  57. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  58. drop procedure BS_CVEGA01
  59. GO
  60. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  61. drop procedure BS_CVEGA02
  62. GO
  63. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  64. drop procedure BS_CVEGA03
  65. GO
  66. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  67. drop procedure BS_CVEGA04
  68. GO
  69.  
  70. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  71. drop procedure BS_PVEGA01
  72. GO
  73. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  74. drop procedure BS_PVEGA02
  75. GO
  76. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  77. drop procedure BS_PVEGA03
  78. GO
  79. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  80. drop procedure BS_PVEGA04
  81. GO
  82.  
  83.  
  84. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  85. drop procedure BS_CGAMMA01
  86. GO
  87. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  88. drop procedure BS_CGAMMA02
  89. GO
  90. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  91. drop procedure BS_CGAMMA03
  92. GO
  93. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  94. drop procedure BS_CGAMMA04
  95. GO
  96.  
  97.  
  98.  
  99. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  100. drop procedure BS_PGAMMA01
  101. GO
  102. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  103. drop procedure BS_PGAMMA02
  104. GO
  105. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  106. drop procedure BS_PGAMMA03
  107. GO
  108. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  109. drop procedure BS_PGAMMA04
  110. GO
  111.  
  112.  
  113. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  114. drop procedure BS_CALL01
  115. GO
  116. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  117. drop procedure BS_CALL02
  118. GO
  119. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  120. drop procedure BS_CALL03
  121. GO
  122. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  123. drop procedure BS_CALL04
  124. GO
  125.  
  126. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  127. drop procedure BS_PUT01
  128. GO
  129. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  130. drop procedure BS_PUT02
  131. GO
  132. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  133. drop procedure BS_PUT03
  134. GO
  135. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  136. drop procedure BS_PUT04
  137. GO
  138. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  139. drop procedure BS_IV01
  140. GO
  141. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  142. drop procedure BS_IV02
  143. GO
  144. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  145. drop procedure BS_IV03
  146. GO
  147. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  148. drop procedure BS_IV04
  149. GO
  150.  
  151. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  152. drop function FBS_CALL01
  153. GO
  154.  
  155. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  156. drop function FBS_CALL02
  157. GO
  158.  
  159. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  160. drop function FBS_CALL03
  161. GO
  162.  
  163. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  164. drop function FBS_CALL04
  165. GO
  166.  
  167. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  168. drop function FBS_PUT01
  169. GO
  170.  
  171. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  172. drop function FBS_PUT02
  173. GO
  174.  
  175. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  176. drop function FBS_PUT03
  177. GO
  178.  
  179. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  180. drop function FBS_PUT04
  181. GO
  182.  
  183. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  184. drop function FBS_IV01
  185. GO
  186.  
  187. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  188. drop function FBS_IV02
  189. GO
  190.  
  191. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  192. drop function FBS_IV03
  193. GO
  194.  
  195. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  196. drop function FBS_IV04
  197. GO
  198.  
  199. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  200. drop function FBS_CDELTA01
  201. GO
  202.  
  203. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  204. drop function FBS_CDELTA02
  205. GO
  206.  
  207. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  208. drop function FBS_CDELTA03
  209. GO
  210.  
  211. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  212. drop function FBS_CDELTA04
  213. GO
  214.  
  215. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  216. drop function FBS_PDELTA01
  217. GO
  218.  
  219. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  220. drop function FBS_PDELTA02
  221. GO
  222.  
  223. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  224. drop function FBS_PDELTA03
  225. GO
  226.  
  227. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  228. drop function FBS_PDELTA04
  229. GO
  230.  
  231.  
  232. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  233. drop function FBS_CTHETA01
  234. GO
  235.  
  236. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  237. drop function FBS_CTHETA02
  238. GO
  239.  
  240. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  241. drop function FBS_CTHETA03
  242. GO
  243.  
  244. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  245. drop function FBS_CTHETA04
  246. GO
  247.  
  248.  
  249. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  250. drop function FBS_PTHETA01
  251. GO
  252.  
  253. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  254. drop function FBS_PTHETA02
  255. GO
  256.  
  257. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  258. drop function FBS_PTHETA03
  259. GO
  260.  
  261. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  262. drop function FBS_PTHETA04
  263. GO
  264.  
  265.  
  266. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  267. drop function FBS_CVEGA01
  268. GO
  269.  
  270. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  271. drop function FBS_CVEGA02
  272. GO
  273.  
  274. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  275. drop function FBS_CVEGA03
  276. GO
  277.  
  278. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  279. drop function FBS_CVEGA04
  280. GO
  281.  
  282.  
  283. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  284. drop function FBS_PVEGA01
  285. GO
  286.  
  287. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  288. drop function FBS_PVEGA02
  289. GO
  290.  
  291. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  292. drop function FBS_PVEGA03
  293. GO
  294.  
  295. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  296. drop function FBS_PVEGA04
  297. GO
  298.  
  299.  
  300.  
  301. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  302. drop function FBS_CGAMMA01
  303. GO
  304.  
  305. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  306. drop function FBS_CGAMMA02
  307. GO
  308.  
  309. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  310. drop function FBS_CGAMMA03
  311. GO
  312.  
  313. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  314. drop function FBS_CGAMMA04
  315. GO
  316.  
  317.  
  318. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  319. drop function FBS_PGAMMA01
  320. GO
  321.  
  322. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  323. drop function FBS_PGAMMA02
  324. GO
  325.  
  326. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  327. drop function FBS_PGAMMA03
  328. GO
  329.  
  330. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  331. drop function FBS_PGAMMA04
  332. GO
  333. DROP ASSEMBLY BlackScholes
  334. */
  335. ---end deleting --
  336.  
  337. CREATE ASSEMBLY BlackScholes
  338. FROM 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\BlackScholes.dll'
  339.  
  340. -- functions --
  341. -- calls --
  342. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  343. drop function FBS_CALL01
  344. GO
  345.  
  346. create function FBS_CALL01
  347. (
  348. @baseActive float,
  349. @strike float,
  350. @timeToExp float,
  351. @riskFree float,
  352. @deviation float,
  353. @dividend float
  354. ) returns float
  355. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CALL01
  356. GO
  357.  
  358. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  359. drop function FBS_CALL02
  360. GO
  361.  
  362. create function FBS_CALL02
  363. (
  364. @baseActive float,
  365. @strike float,
  366. @dayToExp int,
  367. @riskFree float,
  368. @deviation float,
  369. @dividend float
  370. ) returns float
  371. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CALL02
  372. GO
  373.  
  374. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  375. drop function FBS_CALL03
  376. GO
  377.  
  378. create function FBS_CALL03
  379. (
  380. @baseActive float,
  381. @strike float,
  382. @timeToExp float,
  383. @riskFree float,
  384. @deviation float
  385. ) returns float
  386. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CALL03
  387. GO
  388.  
  389. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CALL04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  390. drop function FBS_CALL04
  391. GO
  392.  
  393. create function FBS_CALL04
  394. (
  395. @baseActive float,
  396. @strike float,
  397. @dayToExp int,
  398. @riskFree float,
  399. @deviation float
  400. ) returns float
  401. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CALL04
  402. GO
  403. -- puts --
  404.  
  405. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  406. drop function FBS_PUT01
  407. GO
  408.  
  409. create function FBS_PUT01
  410. (
  411. @baseActive float,
  412. @strike float,
  413. @timeToExp float,
  414. @riskFree float,
  415. @deviation float,
  416. @dividend float
  417. ) returns float
  418. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PUT01
  419. GO
  420.  
  421. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  422. drop function FBS_PUT02
  423. GO
  424.  
  425. create function FBS_PUT02
  426. (
  427. @baseActive float,
  428. @strike float,
  429. @dayToExp int,
  430. @riskFree float,
  431. @deviation float,
  432. @dividend float
  433. ) returns float
  434. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PUT02
  435. GO
  436.  
  437. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  438. drop function FBS_PUT03
  439. GO
  440.  
  441. create function FBS_PUT03
  442. (
  443. @baseActive float,
  444. @strike float,
  445. @timeToExp float,
  446. @riskFree float,
  447. @deviation float
  448. ) returns float
  449. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PUT03
  450. GO
  451.  
  452. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PUT04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  453. drop function FBS_PUT04
  454. GO
  455.  
  456. create function FBS_PUT04
  457. (
  458. @baseActive float,
  459. @strike float,
  460. @dayToExp int,
  461. @riskFree float,
  462. @deviation float
  463. ) returns float
  464. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PUT04
  465. GO
  466.  
  467. -- volatility --
  468. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  469. drop function FBS_IV01
  470. GO
  471. create function FBS_IV01
  472. (
  473. @ot int,
  474. @baseActive float,
  475. @strike float,
  476. @timeToExp float,
  477. @riskFree float,
  478. @premium float,
  479. @dividendas float
  480. ) returns float
  481. EXTERNAL NAME BlackScholes.BlackScholes.FBS_IV01
  482. GO
  483.  
  484. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  485. drop function FBS_IV02
  486. GO
  487. create function FBS_IV02
  488. (
  489. @ot int,
  490. @baseActive float,
  491. @strike float,
  492. @dayToExp int,
  493. @riskFree float,
  494. @premium float,
  495. @dividendas float
  496. ) returns float
  497. EXTERNAL NAME BlackScholes.BlackScholes.FBS_IV02
  498. GO
  499.  
  500.  
  501. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  502. drop function FBS_IV03
  503. GO
  504. create function FBS_IV03
  505. (
  506. @ot int,
  507. @baseActive float,
  508. @strike float,
  509. @timeToExp float,
  510. @riskFree float,
  511. @premium float
  512. ) returns float
  513. EXTERNAL NAME BlackScholes.BlackScholes.FBS_IV03
  514. GO
  515.  
  516. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_IV04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  517. drop function FBS_IV04
  518. GO
  519. create function FBS_IV04
  520. (
  521. @ot int,
  522. @baseActive float,
  523. @strike float,
  524. @dayToExp int,
  525. @riskFree float,
  526. @premium float
  527. ) returns float
  528. EXTERNAL NAME BlackScholes.BlackScholes.FBS_IV04
  529. GO
  530.  
  531.  
  532. --- BS_CDELTA ---
  533.  
  534. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  535. drop function FBS_CDELTA01
  536. GO
  537. create function FBS_CDELTA01
  538. (
  539. @baseActive float,
  540. @strike float,
  541. @timeToExp float,
  542. @riskFree float,
  543. @deviation float,
  544. @dividend float
  545. ) returns float
  546. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CDELTA01
  547. GO
  548.  
  549. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  550. drop function FBS_CDELTA02
  551. GO
  552. create function FBS_CDELTA02
  553. (
  554. @baseActive float,
  555. @strike float,
  556. @dayToExp int,
  557. @riskFree float,
  558. @deviation float,
  559. @dividendas float
  560. ) returns float
  561. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CDELTA02
  562. GO
  563.  
  564.  
  565. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  566. drop function FBS_CDELTA03
  567. GO
  568. create function FBS_CDELTA03
  569. (
  570. @baseActive float,
  571. @strike float,
  572. @timeToExp float,
  573. @riskFree float,
  574. @deviation float
  575. ) returns float
  576. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CDELTA03
  577. GO
  578.  
  579. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CDELTA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  580. drop function FBS_CDELTA04
  581. GO
  582. create function FBS_CDELTA04
  583. (
  584. @baseActive float,
  585. @strike float,
  586. @dayToExp int,
  587. @riskFree float,
  588. @deviation float
  589. ) returns float
  590. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CDELTA04
  591. GO
  592.  
  593. --- BS_PDELTA ---
  594.  
  595. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  596. drop function FBS_PDELTA01
  597. GO
  598. create function FBS_PDELTA01
  599. (
  600. @baseActive float,
  601. @strike float,
  602. @timeToExp float,
  603. @riskFree float,
  604. @deviation float,
  605. @dividendas float
  606. ) returns float
  607. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PDELTA01
  608. GO
  609.  
  610. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  611. drop function FBS_PDELTA02
  612. GO
  613. create function FBS_PDELTA02
  614. (
  615. @baseActive float,
  616. @strike float,
  617. @dayToExp int,
  618. @riskFree float,
  619. @deviation float,
  620. @dividendas float
  621. ) returns float
  622. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PDELTA02
  623. GO
  624.  
  625.  
  626. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  627. drop function FBS_PDELTA03
  628. GO
  629. create function FBS_PDELTA03
  630. (
  631. @baseActive float,
  632. @strike float,
  633. @timeToExp float,
  634. @riskFree float,
  635. @deviation float
  636. ) returns float
  637. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PDELTA03
  638. GO
  639.  
  640. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PDELTA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  641. drop function FBS_PDELTA04
  642. GO
  643. create function FBS_PDELTA04
  644. (
  645. @baseActive float,
  646. @strike float,
  647. @dayToExp int,
  648. @riskFree float,
  649. @deviation float
  650. ) returns float
  651. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PDELTA04
  652. GO
  653.  
  654. ---BS_CTHETA---
  655.  
  656. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  657. drop function FBS_CTHETA01
  658. GO
  659. create function FBS_CTHETA01
  660. (
  661. @baseActive float,
  662. @strike float,
  663. @timeToExp float,
  664. @riskFree float,
  665. @deviation float,
  666. @dividendas float
  667. ) returns float
  668. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CTHETA01
  669. GO
  670.  
  671. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  672. drop function FBS_CTHETA02
  673. GO
  674. create function FBS_CTHETA02
  675. (
  676. @baseActive float,
  677. @strike float,
  678. @dayToExp int,
  679. @riskFree float,
  680. @deviation float,
  681. @dividendas float
  682. ) returns float
  683. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CTHETA02
  684. GO
  685.  
  686.  
  687. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  688. drop function FBS_CTHETA03
  689. GO
  690. create function FBS_CTHETA03
  691. (
  692. @baseActive float,
  693. @strike float,
  694. @timeToExp float,
  695. @riskFree float,
  696. @deviation float
  697. ) returns float
  698. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CTHETA03
  699. GO
  700.  
  701. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CTHETA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  702. drop function FBS_CTHETA04
  703. GO
  704. create function FBS_CTHETA04
  705. (
  706. @baseActive float,
  707. @strike float,
  708. @dayToExp int,
  709. @riskFree float,
  710. @deviation float
  711. ) returns float
  712. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CTHETA04
  713. GO
  714.  
  715. ---BS_PTHETA---
  716.  
  717. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  718. drop function FBS_PTHETA01
  719. GO
  720. create function FBS_PTHETA01
  721. (
  722. @baseActive float,
  723. @strike float,
  724. @timeToExp float,
  725. @riskFree float,
  726. @deviation float,
  727. @dividendas float
  728. ) returns float
  729. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PTHETA01
  730. GO
  731.  
  732. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  733. drop function FBS_PTHETA02
  734. GO
  735. create function FBS_PTHETA02
  736. (
  737. @baseActive float,
  738. @strike float,
  739. @dayToExp int,
  740. @riskFree float,
  741. @deviation float,
  742. @dividendas float
  743. ) returns float
  744. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PTHETA02
  745. GO
  746.  
  747.  
  748. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  749. drop function FBS_PTHETA03
  750. GO
  751. create function FBS_PTHETA03
  752. (
  753. @baseActive float,
  754. @strike float,
  755. @timeToExp float,
  756. @riskFree float,
  757. @deviation float
  758. ) returns float
  759. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PTHETA03
  760. GO
  761.  
  762. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PTHETA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  763. drop function FBS_PTHETA04
  764. GO
  765. create function FBS_PTHETA04
  766. (
  767. @baseActive float,
  768. @strike float,
  769. @dayToExp int,
  770. @riskFree float,
  771. @deviation float
  772. ) returns float
  773. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PTHETA04
  774. GO
  775.  
  776.  
  777.  
  778.  
  779.  
  780. ---BS_CVEGA---
  781.  
  782. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  783. drop function FBS_CVEGA01
  784. GO
  785. create function FBS_CVEGA01
  786. (
  787. @baseActive float,
  788. @strike float,
  789. @timeToExp float,
  790. @riskFree float,
  791. @deviation float,
  792. @dividendas float
  793. ) returns float
  794. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CVEGA01
  795. GO
  796.  
  797. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  798. drop function FBS_CVEGA02
  799. GO
  800. create function FBS_CVEGA02
  801. (
  802. @baseActive float,
  803. @strike float,
  804. @dayToExp int,
  805. @riskFree float,
  806. @deviation float,
  807. @dividendas float
  808. ) returns float
  809. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CVEGA02
  810. GO
  811.  
  812.  
  813. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  814. drop function FBS_CVEGA03
  815. GO
  816. create function FBS_CVEGA03
  817. (
  818. @baseActive float,
  819. @strike float,
  820. @timeToExp float,
  821. @riskFree float,
  822. @deviation float
  823. ) returns float
  824. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CVEGA03
  825. GO
  826.  
  827. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CVEGA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  828. drop function FBS_CVEGA04
  829. GO
  830. create function FBS_CVEGA04
  831. (
  832. @baseActive float,
  833. @strike float,
  834. @dayToExp int,
  835. @riskFree float,
  836. @deviation float
  837. ) returns float
  838. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CVEGA04
  839. GO
  840.  
  841.  
  842.  
  843.  
  844. ---BS_PVEGA---
  845.  
  846. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  847. drop function FBS_PVEGA01
  848. GO
  849. create function FBS_PVEGA01
  850. (
  851. @baseActive float,
  852. @strike float,
  853. @timeToExp float,
  854. @riskFree float,
  855. @deviation float,
  856. @dividendas float
  857. ) returns float
  858. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PVEGA01
  859. GO
  860.  
  861. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  862. drop function FBS_PVEGA02
  863. GO
  864. create function FBS_PVEGA02
  865. (
  866. @baseActive float,
  867. @strike float,
  868. @dayToExp int,
  869. @riskFree float,
  870. @deviation float,
  871. @dividendas float
  872. ) returns float
  873. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PVEGA02
  874. GO
  875.  
  876.  
  877. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  878. drop function FBS_PVEGA03
  879. GO
  880. create function FBS_PVEGA03
  881. (
  882. @baseActive float,
  883. @strike float,
  884. @timeToExp float,
  885. @riskFree float,
  886. @deviation float
  887. ) returns float
  888. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PVEGA03
  889. GO
  890.  
  891. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PVEGA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  892. drop function FBS_PVEGA04
  893. GO
  894. create function FBS_PVEGA04
  895. (
  896. @baseActive float,
  897. @strike float,
  898. @dayToExp int,
  899. @riskFree float,
  900. @deviation float
  901. ) returns float
  902. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PVEGA04
  903. GO
  904.  
  905.  
  906.  
  907.  
  908. ---BS_CGAMMA---
  909.  
  910. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  911. drop function FBS_CGAMMA01
  912. GO
  913. create function FBS_CGAMMA01
  914. (
  915. @baseActive float,
  916. @strike float,
  917. @timeToExp float,
  918. @riskFree float,
  919. @deviation float,
  920. @dividendas float
  921. ) returns float
  922. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CGAMMA01
  923. GO
  924.  
  925. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  926. drop function FBS_CGAMMA02
  927. GO
  928. create function FBS_CGAMMA02
  929. (
  930. @baseActive float,
  931. @strike float,
  932. @dayToExp int,
  933. @riskFree float,
  934. @deviation float,
  935. @dividendas float
  936. ) returns float
  937. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CGAMMA02
  938. GO
  939.  
  940.  
  941. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  942. drop function FBS_CGAMMA03
  943. GO
  944. create function FBS_CGAMMA03
  945. (
  946. @baseActive float,
  947. @strike float,
  948. @timeToExp float,
  949. @riskFree float,
  950. @deviation float
  951. ) returns float
  952. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CGAMMA03
  953. GO
  954.  
  955. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_CGAMMA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  956. drop function FBS_CGAMMA04
  957. GO
  958. create function FBS_CGAMMA04
  959. (
  960. @baseActive float,
  961. @strike float,
  962. @dayToExp int,
  963. @riskFree float,
  964. @deviation float
  965. ) returns float
  966. EXTERNAL NAME BlackScholes.BlackScholes.FBS_CGAMMA04
  967. GO
  968.  
  969.  
  970. ---BS_PGAMMA---
  971.  
  972. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA01') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  973. drop function FBS_PGAMMA01
  974. GO
  975. create function FBS_PGAMMA01
  976. (
  977. @baseActive float,
  978. @strike float,
  979. @timeToExp float,
  980. @riskFree float,
  981. @deviation float,
  982. @dividendas float
  983. ) returns float
  984. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PGAMMA01
  985. GO
  986.  
  987. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA02') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  988. drop function FBS_PGAMMA02
  989. GO
  990. create function FBS_PGAMMA02
  991. (
  992. @baseActive float,
  993. @strike float,
  994. @dayToExp int,
  995. @riskFree float,
  996. @deviation float,
  997. @dividendas float
  998. ) returns float
  999. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PGAMMA02
  1000. GO
  1001.  
  1002.  
  1003. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA03') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  1004. drop function FBS_PGAMMA03
  1005. GO
  1006. create function FBS_PGAMMA03
  1007. (
  1008. @baseActive float,
  1009. @strike float,
  1010. @timeToExp float,
  1011. @riskFree float,
  1012. @deviation float
  1013. ) returns float
  1014. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PGAMMA03
  1015. GO
  1016.  
  1017. if exists (select * from dbo.sysobjects where id = object_id(N'FBS_PGAMMA04') and xtype in (N'FS', N'FN', N'IF', N'TF'))
  1018. drop function FBS_PGAMMA04
  1019. GO
  1020. create function FBS_PGAMMA04
  1021. (
  1022. @baseActive float,
  1023. @strike float,
  1024. @dayToExp int,
  1025. @riskFree float,
  1026. @deviation float
  1027. ) returns float
  1028. EXTERNAL NAME BlackScholes.BlackScholes.FBS_PGAMMA04
  1029. GO
  1030. ---end functions --
  1031.  
  1032. ----DS_CDELTA------
  1033.  
  1034. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1035. drop procedure BS_CDELTA01
  1036. GO
  1037.  
  1038. CREATE PROC BS_CDELTA01
  1039. @baseActive float,
  1040. @strike float,
  1041. @timeToExp float,
  1042. @riskFree float,
  1043. @deviation float,
  1044. @dividend float
  1045. as
  1046. EXTERNAL NAME BlackScholes.BlackScholes.BS_CDELTA01
  1047. GO
  1048.  
  1049. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1050. drop procedure BS_CDELTA02
  1051. GO
  1052. CREATE PROC BS_CDELTA02
  1053. @baseActive float,
  1054. @strike float,
  1055. @dayToExp int,
  1056. @riskFree float,
  1057. @deviation float,
  1058. @dividend float
  1059. as
  1060. EXTERNAL NAME BlackScholes.BlackScholes.BS_CDELTA02
  1061. GO
  1062.  
  1063. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1064. drop procedure BS_CDELTA03
  1065. GO
  1066. CREATE PROC BS_CDELTA03
  1067. @baseActive float,
  1068. @strike float,
  1069. @timeToExp float,
  1070. @riskFree float,
  1071. @deviation float
  1072. as
  1073. EXTERNAL NAME BlackScholes.BlackScholes.BS_CDELTA03
  1074. GO
  1075.  
  1076. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CDELTA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1077. drop procedure BS_CDELTA04
  1078. GO
  1079. CREATE PROC BS_CDELTA04
  1080. @baseActive float,
  1081. @strike float,
  1082. @dayToExp int,
  1083. @riskFree float,
  1084. @deviation float
  1085. as
  1086. EXTERNAL NAME BlackScholes.BlackScholes.BS_CDELTA04
  1087. GO
  1088.  
  1089. ----BS_PDELTA-------------
  1090.  
  1091. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1092. drop procedure BS_PDELTA01
  1093. GO
  1094.  
  1095. CREATE PROC BS_PDELTA01
  1096. @baseActive float,
  1097. @strike float,
  1098. @timeToExp float,
  1099. @riskFree float,
  1100. @deviation float,
  1101. @dividend float
  1102. as
  1103. EXTERNAL NAME BlackScholes.BlackScholes.BS_PDELTA01
  1104. GO
  1105.  
  1106. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1107. drop procedure BS_PDELTA02
  1108. GO
  1109. CREATE PROC BS_PDELTA02
  1110. @baseActive float,
  1111. @strike float,
  1112. @dayToExp int,
  1113. @riskFree float,
  1114. @deviation float,
  1115. @dividend float
  1116. as
  1117. EXTERNAL NAME BlackScholes.BlackScholes.BS_PDELTA02
  1118. GO
  1119.  
  1120. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1121. drop procedure BS_PDELTA03
  1122. GO
  1123. CREATE PROC BS_PDELTA03
  1124. @baseActive float,
  1125. @strike float,
  1126. @timeToExp float,
  1127. @riskFree float,
  1128. @deviation float
  1129. as
  1130. EXTERNAL NAME BlackScholes.BlackScholes.BS_PDELTA03
  1131. GO
  1132.  
  1133. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PDELTA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1134. drop procedure BS_PDELTA04
  1135. GO
  1136. CREATE PROC BS_PDELTA04
  1137. @baseActive float,
  1138. @strike float,
  1139. @dayToExp int,
  1140. @riskFree float,
  1141. @deviation float
  1142. as
  1143. EXTERNAL NAME BlackScholes.BlackScholes.BS_PDELTA04
  1144. GO
  1145.  
  1146.  
  1147. ----BS_CTHETA-------------
  1148.  
  1149. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1150. drop procedure BS_CTHETA01
  1151. GO
  1152.  
  1153. CREATE PROC BS_CTHETA01
  1154. @baseActive float,
  1155. @strike float,
  1156. @timeToExp float,
  1157. @riskFree float,
  1158. @deviation float,
  1159. @dividend float
  1160. as
  1161. EXTERNAL NAME BlackScholes.BlackScholes.BS_CTHETA01
  1162. GO
  1163.  
  1164. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1165. drop procedure BS_CTHETA02
  1166. GO
  1167. CREATE PROC BS_CTHETA02
  1168. @baseActive float,
  1169. @strike float,
  1170. @dayToExp int,
  1171. @riskFree float,
  1172. @deviation float,
  1173. @dividend float
  1174. as
  1175. EXTERNAL NAME BlackScholes.BlackScholes.BS_CTHETA02
  1176. GO
  1177.  
  1178. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1179. drop procedure BS_CTHETA03
  1180. GO
  1181. CREATE PROC BS_CTHETA03
  1182. @baseActive float,
  1183. @strike float,
  1184. @timeToExp float,
  1185. @riskFree float,
  1186. @deviation float
  1187. as
  1188. EXTERNAL NAME BlackScholes.BlackScholes.BS_CTHETA03
  1189. GO
  1190.  
  1191. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CTHETA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1192. drop procedure BS_CTHETA04
  1193. GO
  1194. CREATE PROC BS_CTHETA04
  1195. @baseActive float,
  1196. @strike float,
  1197. @dayToExp int,
  1198. @riskFree float,
  1199. @deviation float
  1200. as
  1201. EXTERNAL NAME BlackScholes.BlackScholes.BS_CTHETA04
  1202. GO
  1203.  
  1204.  
  1205.  
  1206.  
  1207. ----BS_PTHETA-------------
  1208.  
  1209. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1210. drop procedure BS_PTHETA01
  1211. GO
  1212.  
  1213. CREATE PROC BS_PTHETA01
  1214. @baseActive float,
  1215. @strike float,
  1216. @timeToExp float,
  1217. @riskFree float,
  1218. @deviation float,
  1219. @dividend float
  1220. as
  1221. EXTERNAL NAME BlackScholes.BlackScholes.BS_PTHETA01
  1222. GO
  1223.  
  1224. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1225. drop procedure BS_PTHETA02
  1226. GO
  1227. CREATE PROC BS_PTHETA02
  1228. @baseActive float,
  1229. @strike float,
  1230. @dayToExp int,
  1231. @riskFree float,
  1232. @deviation float,
  1233. @dividend float
  1234. as
  1235. EXTERNAL NAME BlackScholes.BlackScholes.BS_PTHETA02
  1236. GO
  1237.  
  1238. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1239. drop procedure BS_PTHETA03
  1240. GO
  1241. CREATE PROC BS_PTHETA03
  1242. @baseActive float,
  1243. @strike float,
  1244. @timeToExp float,
  1245. @riskFree float,
  1246. @deviation float
  1247. as
  1248. EXTERNAL NAME BlackScholes.BlackScholes.BS_PTHETA03
  1249. GO
  1250.  
  1251. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PTHETA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1252. drop procedure BS_PTHETA04
  1253. GO
  1254. CREATE PROC BS_PTHETA04
  1255. @baseActive float,
  1256. @strike float,
  1257. @dayToExp int,
  1258. @riskFree float,
  1259. @deviation float
  1260. as
  1261. EXTERNAL NAME BlackScholes.BlackScholes.BS_PTHETA04
  1262. GO
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268. ----BS_CVEGA-------------
  1269.  
  1270. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1271. drop procedure BS_CVEGA01
  1272. GO
  1273.  
  1274. CREATE PROC BS_CVEGA01
  1275. @baseActive float,
  1276. @strike float,
  1277. @timeToExp float,
  1278. @riskFree float,
  1279. @deviation float,
  1280. @dividend float
  1281. as
  1282. EXTERNAL NAME BlackScholes.BlackScholes.BS_CVEGA01
  1283. GO
  1284.  
  1285. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1286. drop procedure BS_CVEGA02
  1287. GO
  1288. CREATE PROC BS_CVEGA02
  1289. @baseActive float,
  1290. @strike float,
  1291. @dayToExp int,
  1292. @riskFree float,
  1293. @deviation float,
  1294. @dividend float
  1295. as
  1296. EXTERNAL NAME BlackScholes.BlackScholes.BS_CVEGA02
  1297. GO
  1298.  
  1299. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1300. drop procedure BS_CVEGA03
  1301. GO
  1302. CREATE PROC BS_CVEGA03
  1303. @baseActive float,
  1304. @strike float,
  1305. @timeToExp float,
  1306. @riskFree float,
  1307. @deviation float
  1308. as
  1309. EXTERNAL NAME BlackScholes.BlackScholes.BS_CVEGA03
  1310. GO
  1311.  
  1312. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CVEGA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1313. drop procedure BS_CVEGA04
  1314. GO
  1315. CREATE PROC BS_CVEGA04
  1316. @baseActive float,
  1317. @strike float,
  1318. @dayToExp int,
  1319. @riskFree float,
  1320. @deviation float
  1321. as
  1322. EXTERNAL NAME BlackScholes.BlackScholes.BS_CVEGA04
  1323. GO
  1324.  
  1325.  
  1326. ----BS_PVEGA-------------
  1327.  
  1328. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1329. drop procedure BS_PVEGA01
  1330. GO
  1331.  
  1332. CREATE PROC BS_PVEGA01
  1333. @baseActive float,
  1334. @strike float,
  1335. @timeToExp float,
  1336. @riskFree float,
  1337. @deviation float,
  1338. @dividend float
  1339. as
  1340. EXTERNAL NAME BlackScholes.BlackScholes.BS_PVEGA01
  1341. GO
  1342.  
  1343. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1344. drop procedure BS_PVEGA02
  1345. GO
  1346. CREATE PROC BS_PVEGA02
  1347. @baseActive float,
  1348. @strike float,
  1349. @dayToExp int,
  1350. @riskFree float,
  1351. @deviation float,
  1352. @dividend float
  1353. as
  1354. EXTERNAL NAME BlackScholes.BlackScholes.BS_PVEGA02
  1355. GO
  1356.  
  1357. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1358. drop procedure BS_PVEGA03
  1359. GO
  1360. CREATE PROC BS_PVEGA03
  1361. @baseActive float,
  1362. @strike float,
  1363. @timeToExp float,
  1364. @riskFree float,
  1365. @deviation float
  1366. as
  1367. t color="#0000ff">EXTERNAL NAME BlackScholes.BlackScholes.BS_PVEGA03
  1368. GO
  1369.  
  1370. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PVEGA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1371. drop procedure BS_PVEGA04
  1372. GO
  1373. CREATE PROC BS_PVEGA04
  1374. @baseActive float,
  1375. @strike float,
  1376. @dayToExp int,
  1377. @riskFree float,
  1378. @deviation float
  1379. as
  1380. EXTERNAL NAME BlackScholes.BlackScholes.BS_PVEGA04
  1381. GO
  1382.  
  1383.  
  1384.  
  1385. ----BS_CGAMMA-------------
  1386.  
  1387. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1388. drop procedure BS_CGAMMA01
  1389. GO
  1390.  
  1391. CREATE PROC BS_CGAMMA01
  1392. @baseActive float,
  1393. @strike float,
  1394. @timeToExp float,
  1395. @riskFree float,
  1396. @deviation float,
  1397. @dividend float
  1398. as
  1399. EXTERNAL NAME BlackScholes.BlackScholes.BS_CGAMMA01
  1400. GO
  1401.  
  1402. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1403. drop procedure BS_CGAMMA02
  1404. GO
  1405. CREATE PROC BS_CGAMMA02
  1406. @baseActive float,
  1407. @strike float,
  1408. @dayToExp int,
  1409. @riskFree float,
  1410. @deviation float,
  1411. @dividend float
  1412. as
  1413. EXTERNAL NAME BlackScholes.BlackScholes.BS_CGAMMA02
  1414. GO
  1415.  
  1416. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1417. drop procedure BS_CGAMMA03
  1418. GO
  1419. CREATE PROC BS_CGAMMA03
  1420. @baseActive float,
  1421. @strike float,
  1422. @timeToExp float,
  1423. @riskFree float,
  1424. @deviation float
  1425. as
  1426. EXTERNAL NAME BlackScholes.BlackScholes.BS_CGAMMA03
  1427. GO
  1428.  
  1429. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CGAMMA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1430. drop procedure BS_CGAMMA04
  1431. GO
  1432. CREATE PROC BS_CGAMMA04
  1433. @baseActive float,
  1434. @strike float,
  1435. @dayToExp int,
  1436. @riskFree float,
  1437. @deviation float
  1438. as
  1439. EXTERNAL NAME BlackScholes.BlackScholes.BS_CGAMMA04
  1440. GO
  1441.  
  1442.  
  1443.  
  1444. ----BS_PGAMMA-------------
  1445.  
  1446. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1447. drop procedure BS_PGAMMA01
  1448. GO
  1449.  
  1450. CREATE PROC BS_PGAMMA01
  1451. @baseActive float,
  1452. @strike float,
  1453. @timeToExp float,
  1454. @riskFree float,
  1455. @deviation float,
  1456. @dividend float
  1457. as
  1458. EXTERNAL NAME BlackScholes.BlackScholes.BS_PGAMMA01
  1459. GO
  1460.  
  1461. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1462. drop procedure BS_PGAMMA02
  1463. GO
  1464. CREATE PROC BS_PGAMMA02
  1465. @baseActive float,
  1466. @strike float,
  1467. @dayToExp int,
  1468. @riskFree float,
  1469. @deviation float,
  1470. @dividend float
  1471. as
  1472. EXTERNAL NAME BlackScholes.BlackScholes.BS_PGAMMA02
  1473. GO
  1474.  
  1475. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1476. drop procedure BS_PGAMMA03
  1477. GO
  1478. CREATE PROC BS_PGAMMA03
  1479. @baseActive float,
  1480. @strike float,
  1481. @timeToExp float,
  1482. @riskFree float,
  1483. @deviation float
  1484. as
  1485. EXTERNAL NAME BlackScholes.BlackScholes.BS_PGAMMA03
  1486. GO
  1487.  
  1488. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PGAMMA04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1489. drop procedure BS_PGAMMA04
  1490. GO
  1491. CREATE PROC BS_PGAMMA04
  1492. @baseActive float,
  1493. @strike float,
  1494. @dayToExp int,
  1495. @riskFree float,
  1496. @deviation float
  1497. as
  1498. EXTERNAL NAME BlackScholes.BlackScholes.BS_PGAMMA04
  1499. GO
  1500.  
  1501. ---- BS_CALL----------------
  1502.  
  1503. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1504. drop procedure BS_CALL01
  1505. GO
  1506.  
  1507. CREATE PROC BS_CALL01
  1508. @baseActive float,
  1509. @strike float,
  1510. @timeToExp float,
  1511. @riskFree float,
  1512. @deviation float,
  1513. @dividend float
  1514. as
  1515. EXTERNAL NAME BlackScholes.BlackScholes.BS_CALL01
  1516. GO
  1517.  
  1518. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1519. drop procedure BS_CALL02
  1520. GO
  1521. CREATE PROC BS_CALL02
  1522. @baseActive float,
  1523. @strike float,
  1524. @dayToExp int,
  1525. @riskFree float,
  1526. @deviation float,
  1527. @dividend float
  1528. as
  1529. EXTERNAL NAME BlackScholes.BlackScholes.BS_CALL02
  1530. GO
  1531.  
  1532. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1533. drop procedure BS_CALL03
  1534. GO
  1535. CREATE PROC BS_CALL03
  1536. @baseActive float,
  1537. @strike float,
  1538. @timeToExp float,
  1539. @riskFree float,
  1540. @deviation float
  1541. as
  1542. EXTERNAL NAME BlackScholes.BlackScholes.BS_CALL03
  1543. GO
  1544.  
  1545. if exists (select * from dbo.sysobjects where id = object_id(N'BS_CALL04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1546. drop procedure BS_CALL04
  1547. GO
  1548. CREATE PROC BS_CALL04
  1549. @baseActive float,
  1550. @strike float,
  1551. @dayToExp int,
  1552. @riskFree float,
  1553. @deviation float
  1554. as
  1555. EXTERNAL NAME BlackScholes.BlackScholes.BS_CALL04
  1556. GO
  1557. ----------------- put -------------------
  1558. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1559. drop procedure BS_PUT01
  1560. GO
  1561.  
  1562. CREATE PROC BS_PUT01
  1563. @baseActive float,
  1564. @strike float,
  1565. @timeToExp float,
  1566. @riskFree float,
  1567. @deviation float,
  1568. @dividend float
  1569. as
  1570. EXTERNAL NAME BlackScholes.BlackScholes.BS_PUT01
  1571. GO
  1572.  
  1573. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1574. drop procedure BS_PUT02
  1575. GO
  1576. CREATE PROC BS_PUT02
  1577. @baseActive float,
  1578. @strike float,
  1579. @dayToExp int,
  1580. @riskFree float,
  1581. @deviation float,
  1582. @dividend float
  1583. as
  1584. EXTERNAL NAME BlackScholes.BlackScholes.BS_PUT02
  1585. GO
  1586.  
  1587. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1588. drop procedure BS_PUT03
  1589. GO
  1590. CREATE PROC BS_PUT03
  1591. @baseActive float,
  1592. @strike float,
  1593. @timeToExp float,
  1594. @riskFree float,
  1595. @deviation float
  1596. as
  1597. EXTERNAL NAME BlackScholes.BlackScholes.BS_PUT03
  1598. GO
  1599.  
  1600. if exists (select * from dbo.sysobjects where id = object_id(N'BS_PUT04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1601. drop procedure BS_PUT04
  1602. GO
  1603. CREATE PROC BS_PUT04
  1604. @baseActive float,
  1605. @strike float,
  1606. @dayToExp int,
  1607. @riskFree float,
  1608. @deviation float
  1609. as
  1610. EXTERNAL NAME BlackScholes.BlackScholes.BS_PUT04
  1611. GO
  1612. --IV--
  1613. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV01') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1614. drop procedure BS_IV01
  1615. GO
  1616.  
  1617. CREATE PROC BS_IV01
  1618. @ot int,
  1619. @baseActive float,
  1620. @strike float,
  1621. @timeToExp float,
  1622. @riskFree float,
  1623. @premium float,
  1624. @dividendas float
  1625. as
  1626. EXTERNAL NAME BlackScholes.BlackScholes.BS_IV01
  1627. GO
  1628.  
  1629. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV02') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1630. drop procedure BS_IV02
  1631. GO
  1632.  
  1633. CREATE PROC BS_IV02
  1634. @ot int,
  1635. @baseActive float,
  1636. @strike float,
  1637. @timeToExp int,
  1638. @riskFree float,
  1639. @premium float,
  1640. @dividendas float
  1641. as
  1642. EXTERNAL NAME BlackScholes.BlackScholes.BS_IV02
  1643. GO
  1644.  
  1645. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV03') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1646. drop procedure BS_IV03
  1647. GO
  1648.  
  1649. CREATE PROC BS_IV03
  1650. @ot int,
  1651. @baseActive float,
  1652. @strike float,
  1653. @timeToExp float,
  1654. @riskFree float,
  1655. @premium float
  1656. as
  1657. EXTERNAL NAME BlackScholes.BlackScholes.BS_IV03
  1658. GO
  1659.  
  1660. if exists (select * from dbo.sysobjects where id = object_id(N'BS_IV04') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  1661. drop procedure BS_IV04
  1662. GO
  1663.  
  1664. CREATE PROC BS_IV04
  1665. @ot int,
  1666. @baseActive float,
  1667. @strike float,
  1668. @timeToExp int,
  1669. @riskFree float,
  1670. @premium float
  1671. as
  1672. EXTERNAL NAME BlackScholes.BlackScholes.BS_IV04
  1673. GO
  1674.  
  1675. /*
  1676.  
  1677. declare @res float
  1678. select @res=dbo.FBS_PUT04(
  1679. 35165,
  1680. 36000,
  1681. 13,
  1682. 0,
  1683. 0.27)
  1684. print @res
  1685.  
  1686. select @res=dbo.FBS_IV04(
  1687. 2,
  1688. 35165,
  1689. 36000,
  1690. 13,
  1691. 0,
  1692. 1216.11
  1693. )
  1694. print @res
  1695.  
  1696. */

* This source code was highlighted with Source Code Highlighter.

Интересная статья? Поделитесь ею пожалуйста с другими:

Опубликовать в Twitter Написать в Facebook Поделиться ВКонтакте В Google Buzz Записать себе в LiveJournal Показать В Моем Мире В дневник на LI.RU Поделиться ссылкой в Моем Круге

Приглашаю присоединиться ко мне:

Follow Me Я в FaceBook Я ВКонтакте или подпишитесь на обновления блога по RSS

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

*

*


Можно использовать следующие HTML-теги и атрибуты: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>