StockPriceImitation
Stock price movement imitation generator. It is generate by random number.
Installation
Add this line to your application's Gemfile:
gem 'stock_price_imitation'
And then execute:
$ bundle
Or install it yourself as:
$ gem install stock_price_imitation
Usage
require 'stock_price_imitation'
step = 100
first_price = 1000
StockPriceImitation::Generator.new(step, first_price).execute
#=>
# [
# 1000,
# 938.3100086235717,
# 981.4231014813671,
# 1007.3571568991346,
# 1029.2902431426667,
# 982.9669793828307,
# 929.9509085392571,
# 939.4320731877888,
# 896.687366210831,
# 854.1886746209568,
# 939.2926430659182,
# 1003.6951479776594,
# 982.4217723833527,
# 983.7855205021697,
# 903.1200400198854,
# 928.4857252941681,
# 919.9919046908392,
# 844.3172053278877,
# 818.9004760309148,
# 769.859737021469,
# 811.597212604147,
# 868.6645681205346,
# 842.275187071378,
# 792.9731650742258,
# 703.4481384978214,
# 791.1553991795175,
# 803.8125730300483,
# 861.6376677943115,
# 929.5894987271124,
# 986.6277941318276,
# 972.3996383854002,
# 1034.2098291866168,
# 1122.192642359364,
# ...
# ]