tarf_monte_carlo 3.16 → 3.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ce8c237aa74a9e1ba9364b4ca30009af7a01e27b0b3d1881d31e2d611877d6
4
- data.tar.gz: 0fb60c7a494442af9621f8d686e161718381e3e4c88b2862c9af2b27de5267f8
3
+ metadata.gz: 276f4ff7b4eb01c384357328380f3b18d92b08840143aa4e6731fa6bc956af33
4
+ data.tar.gz: 9218e8c67cc612d0680d3a3add75b9d45d01e761b30fbdc8be6a5cfe572a0a15
5
5
  SHA512:
6
- metadata.gz: 41673dec376daaad4d6b364f4fde9c6c6a4ed4022ed733dd8ce6cf15db70fb1e07fec9b065cccb646dc544c18d020d4055548be0174ee2833c5ad3ec0cd2523a
7
- data.tar.gz: ba2e90612c68f7aaea158e7c7c43b19520e745eb8761d03f176f4051ac37fda5cc9ad819d42844334a0d32774aaae5c6f60cc68c326d66f65d3da5a27e08468e
6
+ metadata.gz: f198b43f339a2b9a2d64081c32bbba09e4a2db1889fbce918c80347c7297d421944192a587d56c080716d283414e5baa5aa3425e052f09285247c3a6fb52a1b9
7
+ data.tar.gz: 552ec2cd2724a5eec02ad9deae62c3e8a0db8b14793ca990236cceaa0dff1ed3ff0148616a3cc087ab81d8cd3ab654210258d2ef10337488066cbd81b4b866aa
@@ -98,6 +98,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
98
98
  int KType = NUM2INT( rb_hash_aref(MCInputs, rb_str_new2("knockout_type")) );
99
99
  double S = NUM2DBL( rb_hash_aref(MCInputs, rb_str_new2("spot_rate")) );
100
100
  int Ko_compare_mult = NUM2INT( rb_hash_aref(MCInputs, rb_str_new2("multiplier")) );
101
+ int ConvertNotional = NUM2INT( rb_hash_aref(MCInputs, rb_str_new2("convert_notional")) );
101
102
 
102
103
  // assign leg specific attributes
103
104
  double *pvs_pos = ( double* ) malloc( SCount * sizeof(double) );
@@ -208,6 +209,15 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
208
209
  } else {
209
210
  profit_loss = (*( USts_array + leg )) - Spot;
210
211
  }
212
+
213
+ if (ConvertNotional == 1){
214
+ if(Spot < *( Ps_array + leg )){
215
+ Ns_array[leg] = DBL2NUM( *(Ns_array + leg) / *( LSts_array + leg ));
216
+ } else {
217
+ Ns_array[leg] = DBL2NUM( *(Ns_array + leg) / *( USts_array + leg ));
218
+ }
219
+ }
220
+
211
221
  // dash
212
222
  if ( Spot_dash < *( LSts_array + leg ) ) {
213
223
  profit_loss_dash = Spot_dash - (*( LSts_array + leg ));
@@ -1,7 +1,7 @@
1
1
  # gem build tarf_monte_carlo.gemspec
2
- # gem push -v tarf_monte_carlo-3.15.3.gem
2
+ # gem push -v tarf_monte_carlo-3.17.gem
3
3
  # gem yank tarf_monte_carlo -v 2.3
4
4
 
5
5
  module TarfMonteCarlo
6
- VERSION = "3.16"
6
+ VERSION = "3.21"
7
7
  end
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.16'
4
+ version: '3.21'
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-09-17 00:00:00.000000000 Z
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler