tarf_monte_carlo 3.24 → 3.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82676c437016c3396bd0732ee1d20db01a0d4fea1243b3a4555a3b746024874b
4
- data.tar.gz: 774bf6b5cd0f5193c23477bd190aa88d538ae8f5977151e4129928ec13775354
3
+ metadata.gz: 9b578a4483961831037817279e8d1f3d6fe7e55e4312b51ccac26e757e520996
4
+ data.tar.gz: 7ce9ff317c5f1383499ec18c50be613ec4b9955be99101e9c0aa9b7385c67874
5
5
  SHA512:
6
- metadata.gz: f51579af9e3911d5a23324af39aee42d877e7067d86cf2781889de751fb49fff7df31be62acc450aaed89c7bf85d3f0759c34fb94de6445c47f4392226623e3b
7
- data.tar.gz: fdaff8bcd7ec29be4c0478cad38fe3469baea9ce657262c6e5422967968ccd7a463da96a477cc27bcc9906b5245a28707afac62cb4d1a93c29b9f73a51b25386
6
+ metadata.gz: e9735f0cac81ddcbe4af47ed5f36daeafa57a3bac7c7d88e5d9bee9bc8dd951810054b6bbeb6e34fdc670cdce21ce13360f22665e6856fc307e84bf71401f110
7
+ data.tar.gz: 2580760d17c4f660431a26e3d7afd018da399eb75691f4e0ff08017b872fe371849b2c76b280de675fddb3df2dcd8b45401281bbedf342997ad1a822443eaf3b
@@ -81,7 +81,7 @@ VALUE method_box_muller( VALUE self ) {
81
81
  VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
82
82
  VALUE MCInputs = rb_ary_shift(args);
83
83
  // rb_p(rb_str_new2("MC Inputs:"));
84
- rb_p(MCInputs);
84
+ // rb_p(MCInputs);
85
85
 
86
86
  // seed value for rand() function
87
87
  srand( time(0) );
@@ -248,6 +248,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
248
248
  profit_loss = 0.0;
249
249
  } else if(Spot <= *( CFs_array + leg )){
250
250
  profit_loss = Spot - (*( CFs_array + leg ));
251
+
252
+ if (ConvertNotional == 1){
253
+ Ns_array[leg] = *(TempNs_array + leg) / *( CFs_array + leg );
254
+ }
251
255
  } else {
252
256
  profit_loss = Spot - (*( Xs_array + leg ));
253
257
  }
@@ -256,6 +260,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
256
260
  profit_loss_dash = 0.0;
257
261
  } else if(Spot_dash <= *( CFs_array + leg )){
258
262
  profit_loss_dash = Spot_dash - (*( CFs_array + leg ));
263
+
264
+ if (ConvertNotional == 1){
265
+ Ns_array[leg] = *(TempNs_array + leg) / *( CFs_array + leg );
266
+ }
259
267
  } else {
260
268
  profit_loss_dash = Spot_dash - (*( Xs_array + leg ));
261
269
  }
@@ -283,6 +291,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
283
291
  profit_loss = 0.0;
284
292
  } else if(Spot >= *( CFs_array + leg )){
285
293
  profit_loss = ( ( *( CFs_array + leg ) ) - Spot );
294
+
295
+ if (ConvertNotional == 1){
296
+ Ns_array[leg] = *(TempNs_array + leg) / *( CFs_array + leg );
297
+ }
286
298
  } else {
287
299
  profit_loss = ( ( *( Xs_array + leg ) ) - Spot );
288
300
  }
@@ -291,6 +303,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
291
303
  profit_loss_dash = 0.0;
292
304
  } else if(Spot_dash >= *( CFs_array + leg )){
293
305
  profit_loss_dash = ( ( *( CFs_array + leg ) ) - Spot_dash );
306
+
307
+ if (ConvertNotional == 1){
308
+ Ns_array[leg] = *(TempNs_array + leg) / *( CFs_array + leg );
309
+ }
294
310
  } else {
295
311
  profit_loss_dash = ( ( *( Xs_array + leg ) ) - Spot_dash );
296
312
  }
@@ -367,7 +383,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
367
383
  } else if( KType == POINTS || KType == PIVOT_POINTS || KType == COLLAR_POINTS || KType == DOUBLE_STRIKE_POINTS ) {
368
384
  for( leg = 0; leg < NL; ++leg ) {
369
385
  // simulation normal
370
- rb_p(DBL2NUM(*(Ns_array + leg )));
386
+ // rb_p(DBL2NUM(*(Ns_array + leg )));
371
387
  if ( ko_so_far > 0.0 ) {
372
388
  if( sim[leg] >= 0.0 ) {
373
389
  // knock out condition
@@ -3,5 +3,5 @@
3
3
  # gem yank tarf_monte_carlo -v 2.3
4
4
 
5
5
  module TarfMonteCarlo
6
- VERSION = "3.24"
6
+ VERSION = "3.25"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarf_monte_carlo
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.24'
4
+ version: '3.25'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Routh