tarf_monte_carlo 3.58 → 3.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/tarf_monte_carlo/Makefile +24 -25
- data/ext/tarf_monte_carlo/tarf_monte_carlo.c +37 -24
- data/lib/tarf_monte_carlo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1279c9bdedccf7a5f6e8e9d812d3bc49b36c28dc87c3beac88ecd306d57adb13
|
|
4
|
+
data.tar.gz: ea114bbaf561a65c7825f16c8f8634543dcd9b4d9b52fc71e3b3a6d2d83714fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31c688a15b33b4a647cd52630a2f105c149e25483749c97cbb68292366fbee2bc486e52b9a996e7eccfe0f44f590760abad65c59b541f56c7e0304694b076539
|
|
7
|
+
data.tar.gz: f477dc3707480ca223f4d68e89251eb221aff7f5ae832ac10822be3a745821423ab79382371cd870cd067c566ff5346c6d0ddebe149dfcfa30e65911254a52a5
|
|
@@ -12,12 +12,12 @@ NULLCMD = :
|
|
|
12
12
|
#### Start of system configuration section. ####
|
|
13
13
|
|
|
14
14
|
srcdir = .
|
|
15
|
-
topdir = /
|
|
15
|
+
topdir = /home/user/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0
|
|
16
16
|
hdrdir = $(topdir)
|
|
17
|
-
arch_hdrdir = /
|
|
17
|
+
arch_hdrdir = /home/user/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-linux
|
|
18
18
|
PATH_SEPARATOR = :
|
|
19
19
|
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
|
20
|
-
prefix = $(DESTDIR)/
|
|
20
|
+
prefix = $(DESTDIR)/home/user/.rvm/rubies/ruby-2.5.1
|
|
21
21
|
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
|
22
22
|
rubyarchprefix = $(rubylibprefix)/$(arch)
|
|
23
23
|
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
|
@@ -50,7 +50,7 @@ dvidir = $(docdir)
|
|
|
50
50
|
htmldir = $(docdir)
|
|
51
51
|
infodir = $(datarootdir)/info
|
|
52
52
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
|
53
|
-
oldincludedir = $(
|
|
53
|
+
oldincludedir = $(DESTDIR)/usr/include
|
|
54
54
|
includedir = $(prefix)/include
|
|
55
55
|
localstatedir = $(prefix)/var
|
|
56
56
|
sharedstatedir = $(prefix)/com
|
|
@@ -67,8 +67,8 @@ CC = gcc
|
|
|
67
67
|
CXX = g++
|
|
68
68
|
LIBRUBY = $(LIBRUBY_SO)
|
|
69
69
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
|
70
|
-
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
|
71
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
|
70
|
+
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
|
|
71
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
|
72
72
|
empty =
|
|
73
73
|
OUTFLAG = -o $(empty)
|
|
74
74
|
COUTFLAG = -o $(empty)
|
|
@@ -79,30 +79,30 @@ cflags = $(optflags) $(debugflags) $(warnflags)
|
|
|
79
79
|
cxxflags = $(optflags) $(debugflags) $(warnflags)
|
|
80
80
|
optflags = -O3
|
|
81
81
|
debugflags = -ggdb3
|
|
82
|
-
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -
|
|
83
|
-
CCDLFLAGS = -
|
|
84
|
-
CFLAGS = $(CCDLFLAGS) $(cflags) -
|
|
82
|
+
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized
|
|
83
|
+
CCDLFLAGS = -fPIC
|
|
84
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC $(ARCH_FLAG)
|
|
85
85
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
|
86
86
|
DEFS =
|
|
87
|
-
CPPFLAGS =
|
|
87
|
+
CPPFLAGS = $(DEFS) $(cppflags)
|
|
88
88
|
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
|
89
|
-
ldflags = -L. -fstack-protector -
|
|
90
|
-
dldflags = -Wl
|
|
89
|
+
ldflags = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
|
|
90
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
|
91
91
|
ARCH_FLAG =
|
|
92
92
|
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
|
93
|
-
LDSHARED = $(CC) -
|
|
94
|
-
LDSHAREDXX = $(CXX) -
|
|
95
|
-
AR =
|
|
93
|
+
LDSHARED = $(CC) -shared
|
|
94
|
+
LDSHAREDXX = $(CXX) -shared
|
|
95
|
+
AR = ar
|
|
96
96
|
EXEEXT =
|
|
97
97
|
|
|
98
98
|
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
|
99
|
-
RUBY_SO_NAME = ruby
|
|
99
|
+
RUBY_SO_NAME = ruby
|
|
100
100
|
RUBYW_INSTALL_NAME =
|
|
101
101
|
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
|
102
102
|
RUBYW_BASE_NAME = rubyw
|
|
103
103
|
RUBY_BASE_NAME = ruby
|
|
104
104
|
|
|
105
|
-
arch = x86_64-
|
|
105
|
+
arch = x86_64-linux
|
|
106
106
|
sitearch = $(arch)
|
|
107
107
|
ruby_version = 2.5.0
|
|
108
108
|
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
|
@@ -111,9 +111,9 @@ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h
|
|
|
111
111
|
|
|
112
112
|
RM = rm -f
|
|
113
113
|
RM_RF = $(RUBY) -run -e rm -- -rf
|
|
114
|
-
RMDIRS = rmdir -p
|
|
115
|
-
MAKEDIRS = /
|
|
116
|
-
INSTALL = /usr/
|
|
114
|
+
RMDIRS = rmdir --ignore-fail-on-non-empty -p
|
|
115
|
+
MAKEDIRS = /bin/mkdir -p
|
|
116
|
+
INSTALL = /usr/bin/install -c
|
|
117
117
|
INSTALL_PROG = $(INSTALL) -m 0755
|
|
118
118
|
INSTALL_DATA = $(INSTALL) -m 644
|
|
119
119
|
COPY = cp
|
|
@@ -122,8 +122,8 @@ TOUCH = exit >
|
|
|
122
122
|
#### End of system configuration section. ####
|
|
123
123
|
|
|
124
124
|
preload =
|
|
125
|
-
libpath = . $(libdir)
|
|
126
|
-
LIBPATH = -L. -L$(libdir) -
|
|
125
|
+
libpath = . $(libdir)
|
|
126
|
+
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
|
|
127
127
|
DEFFILE =
|
|
128
128
|
|
|
129
129
|
CLEANFILES = mkmf.log
|
|
@@ -134,7 +134,7 @@ extout =
|
|
|
134
134
|
extout_prefix =
|
|
135
135
|
target_prefix = /tarf_monte_carlo
|
|
136
136
|
LOCAL_LIBS =
|
|
137
|
-
LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -
|
|
137
|
+
LIBS = $(LIBRUBYARG_SHARED) -lpthread -lgmp -ldl -lcrypt -lm -lc
|
|
138
138
|
ORIG_SRCS = tarf_monte_carlo.c
|
|
139
139
|
SRCS = $(ORIG_SRCS)
|
|
140
140
|
OBJS = tarf_monte_carlo.o
|
|
@@ -143,7 +143,7 @@ LOCAL_HDRS =
|
|
|
143
143
|
TARGET = tarf_monte_carlo
|
|
144
144
|
TARGET_NAME = tarf_monte_carlo
|
|
145
145
|
TARGET_ENTRY = Init_$(TARGET_NAME)
|
|
146
|
-
DLLIB = $(TARGET).
|
|
146
|
+
DLLIB = $(TARGET).so
|
|
147
147
|
EXTSTATIC =
|
|
148
148
|
STATIC_LIB =
|
|
149
149
|
|
|
@@ -257,7 +257,6 @@ $(TARGET_SO): $(OBJS) Makefile
|
|
|
257
257
|
$(ECHO) linking shared-object tarf_monte_carlo/$(DLLIB)
|
|
258
258
|
-$(Q)$(RM) $(@)
|
|
259
259
|
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
|
260
|
-
$(Q) $(POSTLINK)
|
|
261
260
|
|
|
262
261
|
|
|
263
262
|
|
|
@@ -66,7 +66,6 @@ VALUE cTarfMonteCarlo = Qnil;
|
|
|
66
66
|
// Prototype for the initialization method - Ruby calls this, not you
|
|
67
67
|
void Init_tarf_monte_carlo();
|
|
68
68
|
double european_payoff(double, double, int, int, double);
|
|
69
|
-
double get_equivalent_notional(int, double, float);
|
|
70
69
|
double get_equivalent_rebate(int, double, float, int);
|
|
71
70
|
bool barrier_variations(int);
|
|
72
71
|
bool double_barrier_variations(int);
|
|
@@ -99,10 +98,6 @@ double european_payoff(double strike, double spot, int cp_sign, int dir_sign, do
|
|
|
99
98
|
return (diff * notional * dir_sign);
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
double get_equivalent_notional(int conversion_sign, double notional, float rate){
|
|
103
|
-
return (conversion_sign == 1) ? (notional / rate) : notional;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
101
|
double get_equivalent_rebate(int conversion_sign, double rebate, float rate, int dir_sign){
|
|
107
102
|
double total = (conversion_sign == 1) ? (rebate * rate) : rebate;
|
|
108
103
|
return (dir_sign * total);
|
|
@@ -286,19 +281,37 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
286
281
|
} else if(KType == FX_AMERICAN_BARRIER_KIKO_UNTIL_KI || KType == FX_AMERICAN_BARRIER_KIKO_UNTIL_EXP){
|
|
287
282
|
profit_loss = Spot;
|
|
288
283
|
profit_loss_dash = Spot_dash;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
284
|
+
|
|
285
|
+
// Both Until KI & Exp
|
|
286
|
+
if ( ((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign < 0) && ((*(Barrier2_array + leg) - *(Xs_array + leg)) * cp_sign > 0) ){
|
|
287
|
+
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg = leg; }
|
|
288
|
+
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg2 = leg; }
|
|
289
|
+
|
|
290
|
+
if ((knockedLeg_dash == -1) && ((*(Barrier_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg_dash = leg; }
|
|
291
|
+
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg2_dash = leg; }
|
|
292
292
|
}
|
|
293
|
-
if(
|
|
294
|
-
|
|
293
|
+
else if( ((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign > 0) && ((*(Barrier2_array + leg) - *(Xs_array + leg)) * cp_sign < 0) ){
|
|
294
|
+
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg = leg; }
|
|
295
|
+
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg2 = leg; }
|
|
296
|
+
|
|
297
|
+
if ((knockedLeg_dash == -1) && ((*(Barrier_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg_dash = leg; }
|
|
298
|
+
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg2_dash = leg; }
|
|
295
299
|
}
|
|
300
|
+
// Only Until Exp
|
|
301
|
+
else if( (KType == FX_AMERICAN_BARRIER_KIKO_UNTIL_EXP) && ((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign > 0) && ((*(Barrier2_array + leg) - *(Barrier_array + leg)) * cp_sign > 0) ){
|
|
302
|
+
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg = leg; }
|
|
303
|
+
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg2 = leg; }
|
|
296
304
|
|
|
297
|
-
|
|
298
|
-
|
|
305
|
+
if ((knockedLeg_dash == -1) && ((*(Barrier_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg_dash = leg; }
|
|
306
|
+
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg2_dash = leg; }
|
|
299
307
|
}
|
|
300
|
-
|
|
301
|
-
|
|
308
|
+
|
|
309
|
+
else if( (KType == FX_AMERICAN_BARRIER_KIKO_UNTIL_EXP) && ((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign < 0) && ((*(Barrier2_array + leg) - *(Barrier_array + leg)) * cp_sign < 0) ){
|
|
310
|
+
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg = leg; }
|
|
311
|
+
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg2 = leg; }
|
|
312
|
+
|
|
313
|
+
if ((knockedLeg_dash == -1) && ((*(Barrier_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg_dash = leg; }
|
|
314
|
+
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg2_dash = leg; }
|
|
302
315
|
}
|
|
303
316
|
} else if(KType == FX_AMERICAN_BARRIER_WINDOW_KNOCKIN || KType == FX_AMERICAN_BARRIER_WINDOW_KNOCKOUT){
|
|
304
317
|
profit_loss = Spot;
|
|
@@ -453,14 +466,14 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
453
466
|
double ko_so_far = K, ko_so_far_dash = K;
|
|
454
467
|
if(KType == FX_AMERICAN_BARRIER_KNOCKIN_DISCRETE || KType == FX_AMERICAN_BARRIER_WINDOW_KNOCKIN){
|
|
455
468
|
if(knockedLeg >= 0){
|
|
456
|
-
double equivalent_notional =
|
|
469
|
+
double equivalent_notional = *( Ns_array + knockedLeg );
|
|
457
470
|
sim_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg) ) ), sim[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
458
471
|
}
|
|
459
472
|
else{
|
|
460
473
|
sim_pos[NL-1] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim[NL-1], dir_sign);
|
|
461
474
|
}
|
|
462
475
|
if(knockedLeg_dash >= 0 ){
|
|
463
|
-
double equivalent_notional =
|
|
476
|
+
double equivalent_notional = *( Ns_array + knockedLeg_dash );
|
|
464
477
|
sim_dash_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg_dash) ) ), sim_dash[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
465
478
|
}
|
|
466
479
|
else{
|
|
@@ -544,13 +557,13 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
544
557
|
if(knockedLeg2 >= 0){
|
|
545
558
|
sim_pos[NL-1] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim[NL-1], dir_sign);
|
|
546
559
|
} else if(knockedLeg >= 0) {
|
|
547
|
-
double equivalent_notional =
|
|
560
|
+
double equivalent_notional = *( Ns_array + knockedLeg );
|
|
548
561
|
sim_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg) ) ), sim[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
549
562
|
}
|
|
550
563
|
if(knockedLeg2_dash >= 0){
|
|
551
564
|
sim_dash_pos[NL-1] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim_dash[NL-1], dir_sign);
|
|
552
565
|
} else if(knockedLeg_dash >= 0) {
|
|
553
|
-
double equivalent_notional =
|
|
566
|
+
double equivalent_notional = *( Ns_array + knockedLeg_dash );
|
|
554
567
|
sim_dash_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg_dash) ) ), sim_dash[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
555
568
|
}
|
|
556
569
|
|
|
@@ -565,7 +578,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
565
578
|
} else if(KType == FX_AMERICAN_BARRIER_KIKO_UNTIL_KI){
|
|
566
579
|
if(knockedLeg >= 0 && knockedLeg2 >= 0){
|
|
567
580
|
if(knockedLeg < knockedLeg2){
|
|
568
|
-
double equivalent_notional =
|
|
581
|
+
double equivalent_notional = *( Ns_array + knockedLeg );
|
|
569
582
|
sim_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg) ) ), sim[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
570
583
|
} else {
|
|
571
584
|
sim_pos[knockedLeg2] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim[knockedLeg2], dir_sign);
|
|
@@ -573,13 +586,13 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
573
586
|
} else if(knockedLeg2 >= 0){
|
|
574
587
|
sim_pos[knockedLeg2] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim[knockedLeg2], dir_sign);
|
|
575
588
|
} else if(knockedLeg >= 0) {
|
|
576
|
-
double equivalent_notional =
|
|
589
|
+
double equivalent_notional = *( Ns_array + knockedLeg );
|
|
577
590
|
sim_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg) ) ), sim[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
578
591
|
}
|
|
579
592
|
|
|
580
593
|
if(knockedLeg_dash >= 0 && knockedLeg2_dash >= 0){
|
|
581
594
|
if(knockedLeg_dash < knockedLeg2_dash){
|
|
582
|
-
double equivalent_notional =
|
|
595
|
+
double equivalent_notional = *( Ns_array + knockedLeg_dash );
|
|
583
596
|
sim_dash_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg_dash) ) ), sim_dash[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
584
597
|
} else {
|
|
585
598
|
sim_dash_pos[knockedLeg2_dash] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim_dash[knockedLeg2_dash], dir_sign);
|
|
@@ -587,7 +600,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
587
600
|
} else if(knockedLeg2_dash >= 0){
|
|
588
601
|
sim_dash_pos[knockedLeg2_dash] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim_dash[knockedLeg2_dash], dir_sign);
|
|
589
602
|
} else if(knockedLeg_dash >= 0) {
|
|
590
|
-
double equivalent_notional =
|
|
603
|
+
double equivalent_notional = *( Ns_array + knockedLeg_dash );
|
|
591
604
|
sim_dash_pos[NL-1] = european_payoff(( *( Xs_array + (knockedLeg_dash) ) ), sim_dash[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
592
605
|
}
|
|
593
606
|
|
|
@@ -604,14 +617,14 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
|
604
617
|
sim_pos[knockedLeg] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + knockedLeg ) ), sim[knockedLeg], dir_sign);
|
|
605
618
|
}
|
|
606
619
|
else{
|
|
607
|
-
double equivalent_notional =
|
|
620
|
+
double equivalent_notional = *( Ns_array + 0 );
|
|
608
621
|
sim_pos[NL-1] = european_payoff(( *( Xs_array + 0 ) ), sim[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
609
622
|
}
|
|
610
623
|
if(knockedLeg_dash >= 0 ){
|
|
611
624
|
sim_dash_pos[knockedLeg_dash] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + knockedLeg_dash ) ), sim[knockedLeg_dash], dir_sign);
|
|
612
625
|
}
|
|
613
626
|
else{
|
|
614
|
-
double equivalent_notional =
|
|
627
|
+
double equivalent_notional = *( Ns_array + 0 );
|
|
615
628
|
sim_dash_pos[NL-1] = european_payoff(( *( Xs_array + 0 ) ), sim_dash[NL-1], cp_sign, dir_sign, equivalent_notional);
|
|
616
629
|
}
|
|
617
630
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tarf_monte_carlo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '3.
|
|
4
|
+
version: '3.63'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vivek Routh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-10-
|
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
141
|
version: '0'
|
|
142
142
|
requirements: []
|
|
143
|
-
rubygems_version: 3.0.
|
|
143
|
+
rubygems_version: 3.0.8
|
|
144
144
|
signing_key:
|
|
145
145
|
specification_version: 4
|
|
146
146
|
summary: Monte Carlo Simulation.
|