All Projects → RWaltersMA → StockPriceGenerator

RWaltersMA / StockPriceGenerator

Licence: other
Python application to write stock security data to a MongoDB Cluster. Supports a variable amount of stocks, variable amount of time and can write to a MongoDB time-series collection

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to StockPriceGenerator

Carbonapi
Implementation of graphite API (graphite-web) in golang
Stars: ✭ 243 (+1057.14%)
Mutual labels:  timeseries
nifi-influxdb-bundle
InfluxDB Processors For Apache NiFi
Stars: ✭ 30 (+42.86%)
Mutual labels:  timeseries
DataGenerator
Automatically generate data for an object
Stars: ✭ 50 (+138.1%)
Mutual labels:  datagenerator
RollingFunctions.jl
Roll a window over data; apply a function over the window.
Stars: ✭ 89 (+323.81%)
Mutual labels:  timeseries
MachineLearning
Machine learning for beginner(Data Science enthusiast)
Stars: ✭ 104 (+395.24%)
Mutual labels:  timeseries
armagarch
ARMA-GARCH
Stars: ✭ 59 (+180.95%)
Mutual labels:  timeseries
Lightkurve
A friendly package for Kepler & TESS time series analysis in Python.
Stars: ✭ 232 (+1004.76%)
Mutual labels:  timeseries
timemachines
Predict time-series with one line of code.
Stars: ✭ 342 (+1528.57%)
Mutual labels:  timeseries
AlphaVantageRB
A Gem for AlphaVantage
Stars: ✭ 68 (+223.81%)
Mutual labels:  timeseries
ClimateTools.jl
Climate science package for Julia
Stars: ✭ 108 (+414.29%)
Mutual labels:  timeseries
prometheus-redistimeseries-adapter
Prometheus remote storage adapter for RedisTimeSeries
Stars: ✭ 23 (+9.52%)
Mutual labels:  timeseries
TimeseriesSurrogates.jl
A Julia package for generating timeseries surrogates
Stars: ✭ 35 (+66.67%)
Mutual labels:  timeseries
kaggle-recruit-restaurant
🏆 Kaggle 8th place solution
Stars: ✭ 102 (+385.71%)
Mutual labels:  timeseries
Mtail
extract internal monitoring data from application logs for collection in a timeseries database
Stars: ✭ 3,028 (+14319.05%)
Mutual labels:  timeseries
JRedisTimeSeries
Java Client for RedisTimeSeries
Stars: ✭ 29 (+38.1%)
Mutual labels:  timeseries
Rrd4j
A high performance data logging and graphing system for time series data.
Stars: ✭ 234 (+1014.29%)
Mutual labels:  timeseries
covid19-timeseries
Covid19 timeseries data store
Stars: ✭ 38 (+80.95%)
Mutual labels:  timeseries
influxdb-client-ruby
InfluxDB 2.0 Ruby Client
Stars: ✭ 30 (+42.86%)
Mutual labels:  timeseries
statsample-timeseries
Statsample TimeSeries
Stars: ✭ 26 (+23.81%)
Mutual labels:  timeseries
rsdmx
Tools for reading SDMX data and metadata in R
Stars: ✭ 93 (+342.86%)
Mutual labels:  timeseries

StockPriceGenerator

This tool will populate a MongoDB database with fake stock price data. Users can specify how many random stock ticker symbols to create as well as how long the data generation should span. Users can also write the data as a time series collection if using MongoDB version 5.0 and above.

Usage:

stockgen.py [-h] [-s NUMBER_OF_SYMBOLS] [-c CONNECTION_STRING] [-d DATABASE_NAME] [-col COLLECTION_NAME] [-x DURATION] [-drop] [-ts] [-as]

Parameter Description Default
-s the number of company symbols 5
-c MongoDB Connection string 127.0.0.1
-d Destination database name StockData
-col Destination collection name Stocks
-x Number of minutes of data to generate 0 - forever
-drop Drop destination collection
-ts Create as timeseries collection
-as Write the tx time as string
-h Lists help on parameters

Note: Time series collections as of MongoDB 5.0 requires the timefield to be in datetime format. In this data generator, the tx_time field is used as the timefield. Thus, if you specify -as and -ts, the data generator will ignore the request to write the tx_time as a string. This will be changed once MongoDB supports timefields of different data types.

Example:

python3 stockgen.py -c 'MONGODB CONNECTION STRING GOES HERE'-s 5 -x 60 -drop -d MyStockExchange -col Securities -ts

In this example, the data generator will create the Securities collection in the MyStockExchange database as a time-series collection. It will first drop the collection before writing 60 minutes worth of 5 security symbols.

Checking MongoDB Connection
Successfully connected to MongoDB

Dropping collection Securities

Create collection result=MyStockExchange.Securities
Data Generation Summary:
# symbols    5           
Database     MyStockExchange
Collection   Securities  

Symbol    Company Name                                      
BLP       BEWILDERED LADY PARTNERS                          
ATL       AGGRESSIVE TABLE LABS                             
RPF       RATTY PERP FOODS                                  
DTV       DRAB TELEPHONE VENTURES                           
HOV       HELPFUL ORIENT VENTURES                           

Start time   2021-09-04 18:24:44
End time     2021-09-04 19:24:44

Generated 100 samples (1%)
Generated 200 samples (1%)
Generated 300 samples (2%)
Generated 400 samples (2%)
Generated 500 samples (3%)
Generated 600 samples (3%)
Generated 700 samples (4%)
Generated 800 samples (4%)
Generated 900 samples (5%)
Generated 1000 samples (6%)
...
Generated 17700 samples (98%)
Generated 17800 samples (99%)
Generated 17900 samples (99%)
Generated 18000 samples (100%)

Finished - 0:45:41

If you connect to your MongoDB cluster you can see the data that resembles the following:

> db.Securities.find()

[{

tx_time: ISODate("2021-09-04T18:24:44.402Z"),
_id: ObjectId("6133f22d5f50f23e222a39a3"),
price: 64.92,
company_symbol: 'BLP',
company_name: 'BEWILDERED LADY PARTNERS'
},
{
tx_time: ISODate("2021-09-04T18:24:44.402Z"),
_id: ObjectId("6133f22d5f50f23e222a39a4"),
price: 66.94,
company_symbol: 'ATL',
company_name: 'AGGRESSIVE TABLE LABS'
},
{
tx_time: ISODate("2021-09-04T18:24:44.402Z"),
_id: ObjectId("6133f22d5f50f23e222a39a5"),
price: 73.7,
company_symbol: 'RPF',
company_name: 'RATTY PERP FOODS'
},

We can take a look at the data through MongoDB Atlas Charts Sample MongoDB Atlas Chart showing sample data from the generator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].