- Make sure postgresql is installed
- Start the postgres local server via
pg_ctl -D /usr/local/var/postgres start
on mac - Start the postgres shell:
psql -U postgres
- Create the database. Looks like this for now:
CREATE TABLE bitcoin_price_data (
day_volume numeric,
price numeric,
market_cap numeric,
time_stamp timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE bitcoin_indicators (
time_stamp_1 numeric,
sma_1 numeric,
time_stamp_5 numeric,
sma_5 numeric,
time_stamp_10 numeric,
sma_10 numeric,
time_stamp_30 numeric,
sma_30 numeric,
time_stamp_60 numeric,
sma_60 numeric,
time_stamp_180 numeric,
sma_180 numeric,
time_stamp_360 numeric,
sma_360 numeric,
time_stamp_720 numeric,
sma_720 numeric,
time_stamp_1440 numeric,
sma_1440 numeric
);
- Go to the DataBase dir
- Run
python PriceDataHandler.py
then runpython IndicatorDataWriter.py
to ensure that table properly updates
If db is set up correctly, this script should work. If it doesn't your table might not be setup correctly.