Skip to content

Commit

Permalink
prep 1.0.5, advance version for release
Browse files Browse the repository at this point in the history
  • Loading branch information
amor71 committed Apr 9, 2021
1 parent 508b667 commit fdac748
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
21 changes: 10 additions & 11 deletions database/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ CREATE INDEX ON trending_tickers(batch_id);
INSERT INTO trending_tickers (symbol, batch_id)
SELECT distinct t.symbol,
r.batch_id
FROM new_trades as t,
algo_run as r
FROM new_trades AS t,
algo_run AS r
WHERE t.algo_run_id = r.algo_run_id
AND batch_id != '';

BEGIN;
BEGIN ;


alter table new_trades
drop constraint "new_trades_qty_check";
alter TABLE new_trades
DROP constraint "new_trades_qty_check";


alter table new_trades add check (qty != 0);
alter TABLE new_trades add check (qty != 0);


COMMIT;
Expand Down Expand Up @@ -178,7 +178,7 @@ CREATE TABLE IF NOT EXISTS trade_analysis (trade_analysis_id serial PRIMARY KEY,
end_tstamp timestamp with time zone NOT NULL,
gain_percentage decimal (5, 2) NOT NULL,
gain_value decimal (8, 2) NOT NULL,
r_units decimal(4,2),
r_units decimal(4, 2),
tstamp timestamp with time zone DEFAULT current_timestamp,
UNIQUE(symbol, algo_run_id, start_tstamp));

Expand All @@ -199,12 +199,11 @@ CREATE INDEX ON portfolio(portfolio_id);
CREATE INDEX ON portfolio(symbol);


alter table new_trades
drop constraint "new_trades_qty_check";
alter TABLE new_trades
DROP constraint "new_trades_qty_check";


ALTER TABLE portfolio RENAME COLUMN "rank" TO "score";


ALTER TABLE portfolio RENAME COLUMN "atr" TO "volatility";

ALTER TABLE portfolio RENAME COLUMN "atr" TO "volatility";
1 change: 1 addition & 0 deletions docs/source/(Advanced) Setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ When using Polygon.io A `Stater`, or above subscription w/ Polygon_ is required.

.. _Polygon: https://polygon.io/pricing

Alpaca is the default data-provider, Unlimited/Pro subscription is recommanded.

Installation
------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Inspired by Andrew Clenow's Book `Stocks On The Move`_ :
* SP500_ analysis notebook.

.. _miner:
https://github.com/amor71/LiuAlgoTrader/blob/master/examples/swing_momentum/portfolio.py
https://github.com/amor71/LiuAlgoTrader/blob/master/examples/swing_momentum/trend.py

.. _configuration:
https://github.com/amor71/LiuAlgoTrader/blob/master/examples/swing_momentum/miner.toml
Expand Down
2 changes: 2 additions & 0 deletions docs/source/What's New.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ What's New
+------------------+----------------------------------------------+
| Release | Notes |
+------------------+----------------------------------------------+
| 0.1.05 | Alapaca data-provider production ready |
+------------------+----------------------------------------------+
| 0.1.00 | **Competible Breaking Release** |
| | |
| | 1. Added support for Alpaca and Polygon |
Expand Down
4 changes: 2 additions & 2 deletions examples/env_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
export DSN="postgresql://momentum@localhost/tradedb"

# Which data providers to use values maybe polygon/alpaca (finnhub coming soon)
export DATA_CONNECTOR="polygon"
export DATA_CONNECTOR="alpaca"

# Polygon API key
export POLYGON_API_KEY=""
Expand All @@ -16,7 +16,7 @@ export ALPACA_BASEURL="https://paper-api.alpaca.markets"
export APCA_API_KEY_ID=""
export APCA_API_SECRET_KEY=""

# "sip" for PRO subscriptions
# "sip" for PRO subscriptions, "iex" for free
export alpaca_data_feed="iex"

# max number of symbols to trade in parallel
Expand Down
4 changes: 2 additions & 2 deletions examples/swing-momentum/miner.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This is a TOML configuration file for market_miner.py
[miners]
[miners.follow_trend]
[miners.trend]
atr_days = 20
volatility_days=90
debug = true
filename = "examples/swing-momentum/follow_trend.py"
filename = "examples/swing-momentum/trend.py"
index = 'SP500'
indicators = ['SMA100']
portfolio_size = 2000
Expand Down
2 changes: 1 addition & 1 deletion liualgotrader/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.04"
__version__ = "0.1.05"
2 changes: 1 addition & 1 deletion liualgotrader/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
env: str


data_connector: DataConnectorType = DataConnectorType[os.getenv("DATA_CONNECTOR", "polygon")] # type: ignore
data_connector: DataConnectorType = DataConnectorType[os.getenv("DATA_CONNECTOR", "alpaca")] # type: ignore

#
# Broker
Expand Down

0 comments on commit fdac748

Please sign in to comment.