tarf_monte_carlo 3.46 → 3.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/tarf_monte_carlo/tarf_monte_carlo.c +9 -10
- data/lib/tarf_monte_carlo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a69379430c97fbbf86b791e49a7564c7504a21fa73f3ea44ede3ec1d3a876bc6
|
4
|
+
data.tar.gz: 3fcd6ef1020d223148c3279c80694c007373f933f434ee48258a62938188c130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55528c53ec418a966b6e8e405ba177038e097993ac5a532bb99c4bfbc8d32048eea25ca8893749207c0ccb6e950ff0fdff6a573e99ccd71a5d627e40b3204a87
|
7
|
+
data.tar.gz: fd79143e72702699469613433aeffcc7fe75fa001c69a6f759582bb72059ba8847862eea11357dc365d73acf06e34a0362d3e09518ac08a865cc0480da13e3ed
|
@@ -419,14 +419,11 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
419
419
|
sim_dash_pos[NL-1] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim_dash[NL-1], dir_sign);
|
420
420
|
}
|
421
421
|
if ((point_pos < DATAPOINTS) && (sim_count % INTERVAL) == 0){
|
422
|
-
metrics[0][point_pos]
|
423
|
-
metrics[1][point_pos]
|
422
|
+
metrics[0][point_pos] = sim[NL-1];
|
423
|
+
metrics[1][point_pos] = (knockedLeg >= 0) ? ( *( Xs_array + (knockedLeg) ) ) : 0;
|
424
|
+
metrics[3][point_pos] = knockedLeg;
|
424
425
|
metrics[0][point_pos+1] = sim_dash[NL-1];
|
425
426
|
metrics[1][point_pos+1] = (knockedLeg_dash >= 0) ? ( *( Xs_array + (knockedLeg_dash) ) ) : 0;
|
426
|
-
|
427
|
-
metrics[2][point_pos] = sim_pos[NL-1];
|
428
|
-
metrics[2][point_pos+1] = sim_dash_pos[NL-1];
|
429
|
-
metrics[3][point_pos] = knockedLeg;
|
430
427
|
metrics[3][point_pos+1] = knockedLeg_dash;
|
431
428
|
}
|
432
429
|
} else if(KType == FX_AMERICAN_BARRIER_KNOCKOUT_DISCRETE){
|
@@ -446,10 +443,12 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
446
443
|
}
|
447
444
|
|
448
445
|
if ((point_pos < DATAPOINTS) && (sim_count % INTERVAL) == 0){
|
449
|
-
metrics[0][point_pos]
|
450
|
-
metrics[1][point_pos]
|
446
|
+
metrics[0][point_pos] = (knockedLeg >= 0) ? sim[knockedLeg] : sim[NL-1];
|
447
|
+
metrics[1][point_pos] = ( *( Xs_array + 0 ) );
|
448
|
+
metrics[3][point_pos] = knockedLeg;
|
451
449
|
metrics[0][point_pos+1] = (knockedLeg_dash >= 0) ? sim[knockedLeg_dash] : sim[NL-1];
|
452
450
|
metrics[1][point_pos+1] = ( *( Xs_array + 0 ) );
|
451
|
+
metrics[3][point_pos+1] = knockedLeg_dash;
|
453
452
|
}
|
454
453
|
|
455
454
|
} else if( KType == ABSOLUTE || KType == PIVOT_ABSOLUTE || KType == COLLAR_ABSOLUTE || KType == DOUBLE_STRIKE_ABSOLUTE ) {
|
@@ -582,8 +581,8 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
582
581
|
|
583
582
|
if (KType == FX_AMERICAN_BARRIER_KNOCKIN_DISCRETE || KType == FX_AMERICAN_BARRIER_KNOCKOUT_DISCRETE){
|
584
583
|
if ((point_pos < DATAPOINTS) && (sim_count % INTERVAL) == 0){
|
585
|
-
|
586
|
-
|
584
|
+
metrics[2][point_pos] = sim_pos_sum;
|
585
|
+
metrics[2][point_pos+1] = sim_dash_pos_sum;
|
587
586
|
point_pos += 2;
|
588
587
|
}
|
589
588
|
}
|