tarf_monte_carlo 3.67 → 3.68
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 +4 -4
- 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: 2fa64303581fdfd8f57be13e97367ccd9c07d64bc7e4eeac8cdaa432d9c7dd71
|
4
|
+
data.tar.gz: 4b6851b1a03af9c991ad0b9d5396c78c81c88ab94c776191fe856d87699c8a1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da44ef843b722f1e2b2ef1b974c0b0d2d725a9a977a8748b72633fd7b55cf5749a8ea284efcb663923384440062038b5784214a58ad6ea280d3cffc19434c58c
|
7
|
+
data.tar.gz: 21318d9c0767bd83ba36ecab123b3189bef337b95c74726beb0e2c99ccc47cd8a356bbde7e14375dc102794dc79ba570b0034fb19c9a2800cc0bc84ac59eff92
|
@@ -283,14 +283,14 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
283
283
|
profit_loss_dash = Spot_dash;
|
284
284
|
|
285
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) ){
|
286
|
+
if ( (((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign) <= 0) && (((*(Barrier2_array + leg) - *(Xs_array + leg)) * cp_sign) >= 0) ){
|
287
287
|
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg = leg; }
|
288
288
|
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg2 = leg; }
|
289
289
|
|
290
290
|
if ((knockedLeg_dash == -1) && ((*(Barrier_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg_dash = leg; }
|
291
291
|
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg2_dash = leg; }
|
292
292
|
}
|
293
|
-
else if( ((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign >= 0) && ((*(Barrier2_array + leg) - *(Xs_array + leg)) * cp_sign <= 0) ){
|
293
|
+
else if( (((*(Barrier_array + leg) - *(Xs_array + leg)) * cp_sign) >= 0) && (((*(Barrier2_array + leg) - *(Xs_array + leg)) * cp_sign) <= 0) ){
|
294
294
|
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg = leg; }
|
295
295
|
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg2 = leg; }
|
296
296
|
|
@@ -298,7 +298,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
298
298
|
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign >= 0)){ knockedLeg2_dash = leg; }
|
299
299
|
}
|
300
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) ){
|
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
302
|
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg = leg; }
|
303
303
|
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign <= 0)){ knockedLeg2 = leg; }
|
304
304
|
|
@@ -306,7 +306,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
306
306
|
if ((knockedLeg2_dash == -1) && ((*(Barrier2_array + leg) - Spot_dash) * cp_sign <= 0)){ knockedLeg2_dash = leg; }
|
307
307
|
}
|
308
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) ){
|
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
310
|
if ((knockedLeg == -1) && ((*(Barrier_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg = leg; }
|
311
311
|
if ((knockedLeg2 == -1) && ((*(Barrier2_array + leg) - Spot) * cp_sign >= 0)){ knockedLeg2 = leg; }
|
312
312
|
|