tarf_monte_carlo 3.23 → 3.24

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: e31ee8faa0b4ae02a93252953f455286d901887af6983874cb32c388842d9038
4
- data.tar.gz: 7ea19ee7948374d024720267a5cb4aa0d532d1acfb0ed7e56fa4401b006af2d7
3
+ metadata.gz: 82676c437016c3396bd0732ee1d20db01a0d4fea1243b3a4555a3b746024874b
4
+ data.tar.gz: 774bf6b5cd0f5193c23477bd190aa88d538ae8f5977151e4129928ec13775354
5
5
  SHA512:
6
- metadata.gz: 60943ac5835b69779f2c3fc89536113b3c99a85413e4e51c6bbbc60d2d3c8266cf1d2a27798c89ae6f8e759ad8eace8825233945173f6c3c57ba06a53fdcbca8
7
- data.tar.gz: c9ff7608e59e0d94b2c2d4d585e5b2a0e28d9064d4e28c547634d2e72da3d7196b912cf89820c594f7fffcf6c3b2f0e910788f1bd41fda1228092ae1c70f332f
6
+ metadata.gz: f51579af9e3911d5a23324af39aee42d877e7067d86cf2781889de751fb49fff7df31be62acc450aaed89c7bf85d3f0759c34fb94de6445c47f4392226623e3b
7
+ data.tar.gz: fdaff8bcd7ec29be4c0478cad38fe3469baea9ce657262c6e5422967968ccd7a463da96a477cc27bcc9906b5245a28707afac62cb4d1a93c29b9f73a51b25386
@@ -114,6 +114,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
114
114
  double *CFs_array = ( double* ) malloc( NL * sizeof(double) );
115
115
  double *LSts_array = ( double* ) malloc( NL * sizeof(double) );
116
116
  double *USts_array = ( double* ) malloc( NL * sizeof(double) );
117
+ double *TempNs_array = ( double* ) malloc( NL * sizeof(double) );
117
118
 
118
119
  VALUE Ls = rb_hash_aref(MCInputs, rb_str_new2("leverage_ratios") );
119
120
  VALUE Ts = rb_hash_aref(MCInputs, rb_str_new2("expiration_times") );
@@ -135,6 +136,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
135
136
  vs_array[leg] = NUM2DBL( rb_ary_entry(vs, leg) );
136
137
  bs_array[leg] = NUM2DBL( rb_ary_entry(bs, leg) );
137
138
  DFs_array[leg] = NUM2DBL( rb_ary_entry(DFs, leg) );
139
+ TempNs_array[leg] = *(Ns_array + leg);
138
140
  }
139
141
  // extra tarf structures
140
142
  if ( KType == PIVOT_POINTS || KType == PIVOT_ABSOLUTE || KType == PIVOT_LEGS ) {
@@ -211,10 +213,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
211
213
  }
212
214
 
213
215
  if (ConvertNotional == 1){
214
- if(Spot < *( Ps_array + leg )){
215
- Ns_array[leg] = *(Ns_array + leg) / *( LSts_array + leg );
216
+ if(Spot < *( Ps_array + leg ) || Spot_dash < *( Ps_array + leg )){
217
+ Ns_array[leg] = *(TempNs_array + leg) / *( LSts_array + leg );
216
218
  } else {
217
- Ns_array[leg] = *(Ns_array + leg) / *( USts_array + leg );
219
+ Ns_array[leg] = *(TempNs_array + leg) / *( USts_array + leg );
218
220
  }
219
221
  }
220
222
 
@@ -3,5 +3,5 @@
3
3
  # gem yank tarf_monte_carlo -v 2.3
4
4
 
5
5
  module TarfMonteCarlo
6
- VERSION = "3.23"
6
+ VERSION = "3.24"
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.23'
4
+ version: '3.24'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Routh