Skip to content

Commit

Permalink
Comment migration
Browse files Browse the repository at this point in the history
Most comments from cpp are migrated here to the header.
  • Loading branch information
84ds84d8s authored Apr 9, 2024
1 parent 7ccd221 commit a122e4c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions random_price.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#ifndef RANDOM_PRICE_H
#define RANDOM_PRICE_H

/**
#ifndef
#define are to prevent double include the header
*/
/**
* Initial Stock Price Generator
* if a=1 mean 5 sd 2; if a=2 mean 50 sd 20; if a=3 mean 150 sd 50;
* if a=2 mean 50 sd 20; if a=3 mean 150 sd 50; else mean 5 sd 2;
*Stock prices cluster in 3 tiers in our world: about 5 hkd (a=ELSE) variating about 2 hkd; , 50 hkd(a=2) variating about 20 hkd,
*and 150 hkd(a=3)variating about 50 hkd (based on a very little sample observation of real world).
*/
double init_stock_price(int a);
/**
* Stock Standard Deviation Generator (for both initial and after initial)
* mean 0.03*init_price; s.d. 0.02*init_price (yes, s.d. of s.d.)
* s.d. usually 1%-5% of initial stock price;
* modelling with absolute value of norm dist mean 0.03*init_price; s.d. 0.02*init_price (yes, s.d. of s.d.)
*/
double random_sd(float init_price);
/**
Expand All @@ -22,6 +26,7 @@ double random_sd(float init_price);
double random_stock(float &mean, float &sd,float &upper_limit, float &lower_limit);
/**
* Random integer function in choosing stock type
* Return a random integer from 0 to max - 1
*/
unsigned int random_integer(unsigned int max_integer);
#endif

0 comments on commit a122e4c

Please sign in to comment.