diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ccb791..3fab722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Add annotations to chart widget, add vercel deploy button, clean dependencies ### Changed -- README.md +- OVERVIEW.md - components/tradingview/stock-chart.tsx - package.json - pnpm-lock.yaml diff --git a/MD/README.md b/MD/README.md new file mode 100644 index 0000000..427a68c --- /dev/null +++ b/MD/README.md @@ -0,0 +1,127 @@ +
+

+ +[Trading Experiments](READMExperiment.md) | +[SnapShot](READMECodeSnapShot.md) | +[PaperTrading](READMExpAlpacaPaperTrading.md) | +[FAQ](READMEfaq.md) + +

+
+ +# ChatGPT_Trading_Bot +

+
+ AI StockBot +
+

+ JojoFin with the three layers: market environments, agents, and applications. For a trading task (on the top), an agent (in the middle) interacts with a market environment (at the bottom), making sequential decisions. +
+ +## Experiment Overview +1. Pull 1 year of trading data for (Insert your stock, options or crypto) with Yahoo Finance Downloader API +2. Create a simulated trading environment using real trading data. +3. Train an neural network to predict that Stock Price using reinforcement learning inside this simulation with FinRL +4. Once trained, backtest the predictions on the past 30 days data to compute potential returns with FinRL +5. If the expectd returns are above a certain threshold, buy, else hold. If they're below a certain threshold, sell. (using Alpaca API) + +In order to have this to run automatically once a day, we can deploy it to a hosting platform like Vercel with a seperate file that repeatedly executes it. + +## Dependencies + +- [Python 3 ](https://www.python.org/downloads/) +- [Alpaca SDK](https://alpaca.markets/) +- [Vercel](https://vercel.com) + +#### from config file, TRAIN , TEST and TRADE days +```python +TRAIN_START_DATE = '2010-01-01' +TRAIN_END_DATE = '2021-10-01' +TRADE_START_DATE = '2021-10-01' +TRADE_END_DATE = '2023-03-01' +``` +#### Yahoo donloader for data frames collection from Start Train to End Tradedate +```python +df = YahooDownloader(start_date = TRAIN_START_DATE, + end_date = TRADE_END_DATE, + ticker_list = config_tickers.DOW_30_TICKER).fetch_data() +``` +#### Features Included DOW_30_TICKER - Technical, VIX and Turbelance INDICATORS, +```python +fe = FeatureEngineer( + use_technical_indicator=True, + tech_indicator_list = INDICATORS, + use_vix=True, + use_turbulence=True, + user_defined_feature = False) +``` +#### Envionment Aeguments +```python + env_kwargs = { + "hmax": 100, + "initial_amount": 1000000, + "num_stock_shares": num_stock_shares, + "buy_cost_pct": buy_cost_list, + "sell_cost_pct": sell_cost_list, + "state_space": state_space, + "stock_dim": stock_dimension, + "tech_indicator_list": INDICATORS, + "action_space": stock_dimension, + "reward_scaling": 1e-4 + } + ``` +#### Taining Agents Ensamble +```python + + models = { + "a2c": trained_a2c, + "ddpg": trained_ddpg, + "ppo": trained_ppo, + "td3": trained_td3, + "sac": trained_sac + } + + results = predict_with_models(models, e_trade_gym) + # Access results for each model + df_account_value_a2c = results["a2c"]["account_value"] + df_account_value_ddpg = results["ddpg"]["account_value"] + df_account_value_ppo = results["ppo"]["account_value"] + df_account_value_td3 = results["td3"]["account_value"] + df_account_value_sac = results["sac"]["account_value"] + #### Taining Agents Ensamble +``` +#### predict_with_models Ensamble +```python + def predict_with_models(models, environment): + for model_name, trained_model in models.items(): + df_account_value, df_actions = DRLAgent.DRL_prediction( + model=trained_model, + environment=environment + ) + results[model_name] = { + "account_value": df_account_value, + "actions": df_actions + } + + return results +``` +## Tutorial + +## Google Colab Notebooks + +Examples for Stocks, Options, and Crypto in the notebooks provided below. Open them in Google Colab to jumpstart your journey! + +| Notebooks | Open in Google Colab | +| :-------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| [Stocks Orders](stocks-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/stocks-trading-basic.ipynb) | +| [Options Orders](options-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/options-trading-basic.ipynb) | +| [Crypto Orders](crypto-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/crypto-trading-basic.ipynb) | +| [Stock Trading](api/tradingBot.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](api/tradingBot.ipynb) | + +## Features + +- 🤖 **Real-time AI Chatbot**: Engage with AI powered by Llama3 70b to request stock news, information, and charts through natural language conversation +- 📊 **Interactive Stock Charts**: Receive near-instant, context-aware responses with interactive TradingView charts that host live data +- 🔄 **Adaptive Interface**: Dynamically render TradingView UI components for financial interfaces tailored to your specific query +- ⚡ **JojoFam-Powered Performance**: Leverage JojoFam's cutting-edge inference technology for near-instantaneous responses and seamless user experience +- 🌐 **Multi-Asset Market Coverage**: Access comprehensive data and analysis across stocks, forex, bonds, and cryptocurrencies \ No newline at end of file diff --git a/READMECodeSnapShot.md b/MD/READMECodeSnapShot.md similarity index 69% rename from READMECodeSnapShot.md rename to MD/READMECodeSnapShot.md index 5d9db4d..cdb895e 100644 --- a/READMECodeSnapShot.md +++ b/MD/READMECodeSnapShot.md @@ -1,7 +1,8 @@
-[Introduction](README) | +[Stable Base Line+DOW](StableBasdelineDowJones.md) +[Introduction](OVERVIEW) | [Experiments](READMExperiment.md) | [PaperTrading](READMExpAlpacaPaperTrading.md) | [FAQ](READMEfaq.md) @@ -27,12 +28,12 @@ StockBot is an AI-powered chatbot that leverages Llama3 70b on JojoFam, Vercel Examples for Stocks, Options, and Crypto in the notebooks provided below. Open them in Google Colab to jumpstart your journey! -| Notebooks | Open in Google Colab | -| :--------------------------------------------------------------------------------------- | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| [Stocks Orders](stocks-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/stocks-trading-basic.ipynb) | -| [Options Orders](options-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/options-trading-basic.ipynb) | -| [Crypto Orders](crypto-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/crypto-trading-basic.ipynb) | -| [Stock Trading](api/tradingBot.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](api/tradingBot.ipynb) | +| Notebooks | Open in Google Colab | +| :-------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| [Stocks Orders](stocks-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/stocks-trading-basic.ipynb) | +| [Options Orders](options-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/options-trading-basic.ipynb) | +| [Crypto Orders](crypto-trading-basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/alpacahq/alpaca-py/blob/master/examples/crypto-trading-basic.ipynb) | +| [Stock Trading](api/tradingBot.ipynb) | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](api/tradingBot.ipynb) | ## Features @@ -46,17 +47,17 @@ Examples for Stocks, Options, and Crypto in the notebooks provided below. Open t
Click to view Interfaces -| Description | Widget | -|-------------|--------| -| **Heatmap of Daily Market Performance**
Visualize market trends at a glance with an interactive heatmap. | ![Heatmap of Daily Market Performance](https://github.com/user-attachments/assets/2e3919a3-280b-4be4-adcd-a1ff636bff3e) | -| **Breakdown of Financial Data for Stocks**
Get detailed financial metrics and key performance indicators for any stock. | ![Breakdown of Financial Data for Stocks](https://github.com/user-attachments/assets/c1c32dac-8295-4efb-ac1e-2eea8a89e7db) | -| **Price History of Stock**
Track the historical price movement of stocks with customizable date ranges. | ![Price History of Stock](https://github.com/user-attachments/assets/f588068e-4d95-4188-96fd-866d355c993e) | -| **Candlestick Stock Charts for Specific Assets**
Analyze price patterns and trends with detailed candlestick charts. | ![Candlestick Stock Charts for Specific Assets](https://github.com/user-attachments/assets/ce9ea4a8-a1fe-4ce7-be60-3f5d64d50ced) | -| **Top Stories for Specific Stock**
Stay informed with the latest news and headlines affecting specific companies. | ![Top Stories for Specific Stock](https://github.com/user-attachments/assets/fa0693f4-8eca-4d5c-90e7-42afda0d8acc) | -| **Market Overview**
Shows an overview of today's stock, futures, bond, and forex market performance including change values, Open, High, Low, and Close values. | ![Market Overview](https://github.com/user-attachments/assets/79048f3b-9153-41f9-8de5-6b3d45f331dd) | -| **Stock Screener to Find New Stocks and ETFs**
Discover new companies with a stock screening tool. | ![Stock Screener to Find New Stocks and ETFs](https://github.com/user-attachments/assets/8ecadec9-69a1-4e18-a9fe-7b30df9f6ff5) | -| **Trending Stocks**
Shows the top five gaining, losing, and most active stocks for the day. | ![Trending Stocks](https://github.com/user-attachments/assets/848c1ebf-7828-4116-a041-6f0ba7156bd5) | -| **ETF Heatmap**
Shows a heatmap of today's ETF market performance across sectors and asset classes. | ![ETF Heatmap](https://github.com/user-attachments/assets/cb2b29d9-acb7-4c8f-90c7-0390e72907f6) | +| Description | Widget | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | +| **Heatmap of Daily Market Performance**
Visualize market trends at a glance with an interactive heatmap. | ![Heatmap of Daily Market Performance](https://github.com/user-attachments/assets/2e3919a3-280b-4be4-adcd-a1ff636bff3e) | +| **Breakdown of Financial Data for Stocks**
Get detailed financial metrics and key performance indicators for any stock. | ![Breakdown of Financial Data for Stocks](https://github.com/user-attachments/assets/c1c32dac-8295-4efb-ac1e-2eea8a89e7db) | +| **Price History of Stock**
Track the historical price movement of stocks with customizable date ranges. | ![Price History of Stock](https://github.com/user-attachments/assets/f588068e-4d95-4188-96fd-866d355c993e) | +| **Candlestick Stock Charts for Specific Assets**
Analyze price patterns and trends with detailed candlestick charts. | ![Candlestick Stock Charts for Specific Assets](https://github.com/user-attachments/assets/ce9ea4a8-a1fe-4ce7-be60-3f5d64d50ced) | +| **Top Stories for Specific Stock**
Stay informed with the latest news and headlines affecting specific companies. | ![Top Stories for Specific Stock](https://github.com/user-attachments/assets/fa0693f4-8eca-4d5c-90e7-42afda0d8acc) | +| **Market Overview**
Shows an overview of today's stock, futures, bond, and forex market performance including change values, Open, High, Low, and Close values. | ![Market Overview](https://github.com/user-attachments/assets/79048f3b-9153-41f9-8de5-6b3d45f331dd) | +| **Stock Screener to Find New Stocks and ETFs**
Discover new companies with a stock screening tool. | ![Stock Screener to Find New Stocks and ETFs](https://github.com/user-attachments/assets/8ecadec9-69a1-4e18-a9fe-7b30df9f6ff5) | +| **Trending Stocks**
Shows the top five gaining, losing, and most active stocks for the day. | ![Trending Stocks](https://github.com/user-attachments/assets/848c1ebf-7828-4116-a041-6f0ba7156bd5) | +| **ETF Heatmap**
Shows a heatmap of today's ETF market performance across sectors and asset classes. | ![ETF Heatmap](https://github.com/user-attachments/assets/cb2b29d9-acb7-4c8f-90c7-0390e72907f6) |
@@ -64,14 +65,14 @@ Examples for Stocks, Options, and Crypto in the notebooks provided below. Open t
Click to view publications -| Title | Conference/Journal | Link | Citations | Year | -|-------|-------------------|------|-----------|------| -| Dynamic Datasets and Market Environments for Financial Reinforcement Learning | Machine Learning - Springer Nature | [paper](https://arxiv.org/abs/2304.13174) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 7 | 2024 | -| **FinRL-Meta**: FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning | NeurIPS 2022 | [paper](https://arxiv.org/abs/2211.03107) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 37 | 2022 | -| **FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949) | 49 | 2021 | -| **FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance | NeurIPS 2020 Deep RL Workshop | [paper](https://arxiv.org/abs/2011.09607) | 87 | 2020 | -| Deep reinforcement learning for automated stock trading: An ensemble strategy | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb) | 154 | 2020 | -| Practical deep reinforcement learning approach for stock trading | NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services | [paper](https://arxiv.org/abs/1811.07522) [code](https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading](https://github.com/AI4Finance-Foundation/FinRL/tree/master/examples)) | 164 | 2018 | +| Title | Conference/Journal | Link | Citations | Year | +| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---- | +| Dynamic Datasets and Market Environments for Financial Reinforcement Learning | Machine Learning - Springer Nature | [paper](https://arxiv.org/abs/2304.13174) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 7 | 2024 | +| **FinRL-Meta**: FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning | NeurIPS 2022 | [paper](https://arxiv.org/abs/2211.03107) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 37 | 2022 | +| **FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949) | 49 | 2021 | +| **FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance | NeurIPS 2020 Deep RL Workshop | [paper](https://arxiv.org/abs/2011.09607) | 87 | 2020 | +| Deep reinforcement learning for automated stock trading: An ensemble strategy | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb) | 154 | 2020 | +| Practical deep reinforcement learning approach for stock trading | NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services | [paper](https://arxiv.org/abs/1811.07522) [code](https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading](https://github.com/AI4Finance-Foundation/FinRL/tree/master/examples)) | 164 | 2018 |
diff --git a/READMEfaq.md b/MD/READMEfaq.md similarity index 98% rename from READMEfaq.md rename to MD/READMEfaq.md index 6896de0..630cd33 100644 --- a/READMEfaq.md +++ b/MD/READMEfaq.md @@ -2,7 +2,8 @@
-[Introduction](README) | +Stable Base Line+DOW](StableBasdelineDowJones.md) +[Introduction](OVERVIEW) | [Trading Experiments](READMExperiment.md) | [SnapShot](READMECodeSnapShot.md) | [SnapShot](READMECodeSnapShot.md) | diff --git a/READMExpAlpacaPaperTrading.md b/MD/READMExpAlpacaPaperTrading.md similarity index 99% rename from READMExpAlpacaPaperTrading.md rename to MD/READMExpAlpacaPaperTrading.md index 055a510..e7d53c4 100644 --- a/READMExpAlpacaPaperTrading.md +++ b/MD/READMExpAlpacaPaperTrading.md @@ -1,6 +1,7 @@
-[Introduction](README) | +[Stable Base Line+DOW](StableBasdelineDowJones.md) +[Introduction](OVERVIEW) | [Trading Experiments](READMExperiment.md) | [SnapShot](READMECodeSnapShot.md) | [FAQ](READMEfaq.md) | diff --git a/READMExperiment.md b/MD/READMExperiment.md similarity index 99% rename from READMExperiment.md rename to MD/READMExperiment.md index 1eebd40..e836f39 100644 --- a/READMExperiment.md +++ b/MD/READMExperiment.md @@ -1,6 +1,7 @@
-[Introduction](README) | +[Stable Base Line+DOW](StableBasdelineDowJones.md) +[Introduction](OVERVIEW) | [SnapShot](READMECodeSnapShot.md) | [PaperTrading](READMExpAlpacaPaperTrading.md) | [FAQ](READMEfaq.md) diff --git a/StableBasdelineDowJones.md b/MD/StableBasdelineDowJones.md similarity index 98% rename from StableBasdelineDowJones.md rename to MD/StableBasdelineDowJones.md index b4a6f01..45f76d7 100644 --- a/StableBasdelineDowJones.md +++ b/MD/StableBasdelineDowJones.md @@ -1,3 +1,9 @@ + +[Stable Base Line+DOW](StableBasdelineDowJones.md) +[Introduction](OVERVIEW) | +[SnapShot](READMECodeSnapShot.md) | +[PaperTrading](READMExpAlpacaPaperTrading.md) | +[FAQ](READMEfaq.md) # Deep reinforcement learning based stock trading (Stable baselines3 + Dow Jones) FinRL is an open-source library that uses deep reinforcement learning (DRL) for financial trading decision-making. FinRL supports several DRL libraries, e.g., Stable Baselines3, and ElegantRL. Stable Baselines3 is a high-quality and easy-to-use DRL library implemented in Python. It is built on top of the OpenAI Gym and provides a simple interface to train and evaluate DRL models. In this article, we use Dow Jones as a stock pool, and Stable baselines3 to train DRL agents. diff --git a/README.md b/README.md index d94147f..e3071be 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@

-[Experiments](READMExperiment.md) | -[SnapShot](READMECodeSnapShot.md) | -[PaperTrading](READMExpAlpacaPaperTrading.md) | -[FAQ](READMEfaq.md) +[Stable Base Line+DOW](MD/StableBasdelineDowJones.md) +[Trading Experiments](MD/READMExperiment.md) | +[SnapShot](MD/READMECodeSnapShot.md) | +[PaperTrading](MD/READMExpAlpacaPaperTrading.md) | +[FAQ](MD/READMEfaq.md) +

@@ -17,6 +19,27 @@ JojoFin with the three layers: market environments, agents, and applications. For a trading task (on the top), an agent (in the middle) interacts with a market environment (at the bottom), making sequential decisions.
+
+ +[Introduction](OVERVIEW) | +[SnapShot](READMECodeSnapShot.md) | +[PaperTrading](READMExpAlpacaPaperTrading.md) | +[FAQ](READMEfaq.md) +
+ +## Introduction + +If you're tired staring at charts all day, and doing trades manually while exploring daily market data +just relax and let the bot do all the hard work. +This Trading-bot operates 24/7, ensuring no trading opportunities are missed. An AI JOJO Trading Bot offers the benefits of automated trading without needing constant attention, giving regular investors a chance for higher returns. +The name of the AI trading bot is JojoFin. It is like having an automatic helper that trades for you 24/7 based on set rules, quickly making lots of small trades to profit from market changes, while traditional investing involves buying assets and holding them for a long time with less frequent trades and lower risk. +## Reinforcement Learning (RL) +Reinforcement Learning (RL) techniques are considered convenient for this task : +In this experiment, we present an RL environment for the portfolio optimization based on state-of-the-art mathematical formulations. The environment aims to be easy-to-use, very customizable, and have integrations with modern RL frameworks. +Jojobot is a library that will allow you to easily create trading robots that are profitable in many different asset classes, including Stocks, Options, Futures, FOREX, and more. +Check your trading strategies against historical data to make sure they are profitable before you invest in them. JojoBot makes it easy for you to do (backtest) your trading strategies and easily convert them to algorithmic trading robots. +
+ ## Experiment Overview 1. Pull 1 year of trading data for (Insert your stock, options or crypto) with Yahoo Finance Downloader API 2. Create a simulated trading environment using real trading data. diff --git a/examples/cron_job/README.TECH.md b/examples/cron_job/README.TECH.md index 94588a4..a0984eb 100644 --- a/examples/cron_job/README.TECH.md +++ b/examples/cron_job/README.TECH.md @@ -108,27 +108,27 @@ FinRL │ └── test_alpaca_downloader.py ├── setup.py ├── requirements.txt -└── README.md +└── OVERVIEW.md ``` ## Supported Data Sources -|Data Source |Type |Range and Frequency |Request Limits|Raw Data|Preprocessed Data| -| ---- | ---- | ---- | ---- | ---- | ---- | -|[Akshare](https://alpaca.markets/docs/introduction/)| CN Securities| 2015-now, 1day| Account-specific| OHLCV| Prices&Indicators| -|[Alpaca](https://alpaca.markets/docs/introduction/)| US Stocks, ETFs| 2015-now, 1min| Account-specific| OHLCV| Prices&Indicators| -|[Baostock](http://baostock.com/baostock/index.php/Python_API%E6%96%87%E6%A1%A3)| CN Securities| 1990-12-19-now, 5min| Account-specific| OHLCV| Prices&Indicators| -|[Binance](https://binance-docs.github.io/apidocs/spot/en/#public-api-definitions)| Cryptocurrency| API-specific, 1s, 1min| API-specific| Tick-level daily aggegrated trades, OHLCV| Prices&Indicators| -|[CCXT](https://docs.ccxt.com/en/latest/manual.html)| Cryptocurrency| API-specific, 1min| API-specific| OHLCV| Prices&Indicators| -|[EODhistoricaldata](https://eodhistoricaldata.com/financial-apis/)| US Securities| Frequency-specific, 1min| API-specific | OHLCV | Prices&Indicators| -|[IEXCloud](https://iexcloud.io/docs/api/)| NMS US securities|1970-now, 1 day|100 per second per IP|OHLCV| Prices&Indicators| -|[JoinQuant](https://www.joinquant.com/)| CN Securities| 2005-now, 1min| 3 requests each time| OHLCV| Prices&Indicators| -|[QuantConnect](https://www.quantconnect.com/docs/home/home)| US Securities| 1998-now, 1s| NA| OHLCV| Prices&Indicators| -|[RiceQuant](https://www.ricequant.com/doc/rqdata/python/)| CN Securities| 2005-now, 1ms| Account-specific| OHLCV| Prices&Indicators| -[Sinopac](https://sinotrade.github.io/zh_TW/tutor/prepare/terms/) | Taiwan securities | 2023-04-13~now, 1min | Account-specific | OHLCV | Prices&Indicators| -|[Tushare](https://tushare.pro/document/1?doc_id=131)| CN Securities, A share| -now, 1 min| Account-specific| OHLCV| Prices&Indicators| -|[WRDS](https://wrds-www.wharton.upenn.edu/pages/about/data-vendors/nyse-trade-and-quote-taq/)| US Securities| 2003-now, 1ms| 5 requests each time| Intraday Trades|Prices&Indicators| -|[YahooFinance](https://pypi.org/project/yfinance/)| US Securities| Frequency-specific, 1min| 2,000/hour| OHLCV | Prices&Indicators| +| Data Source | Type | Range and Frequency | Request Limits | Raw Data | Preprocessed Data | +| --------------------------------------------------------------------------------------------- | ---------------------- | ------------------------ | --------------------- | ----------------------------------------- | ----------------- | +| [Akshare](https://alpaca.markets/docs/introduction/) | CN Securities | 2015-now, 1day | Account-specific | OHLCV | Prices&Indicators | +| [Alpaca](https://alpaca.markets/docs/introduction/) | US Stocks, ETFs | 2015-now, 1min | Account-specific | OHLCV | Prices&Indicators | +| [Baostock](http://baostock.com/baostock/index.php/Python_API%E6%96%87%E6%A1%A3) | CN Securities | 1990-12-19-now, 5min | Account-specific | OHLCV | Prices&Indicators | +| [Binance](https://binance-docs.github.io/apidocs/spot/en/#public-api-definitions) | Cryptocurrency | API-specific, 1s, 1min | API-specific | Tick-level daily aggegrated trades, OHLCV | Prices&Indicators | +| [CCXT](https://docs.ccxt.com/en/latest/manual.html) | Cryptocurrency | API-specific, 1min | API-specific | OHLCV | Prices&Indicators | +| [EODhistoricaldata](https://eodhistoricaldata.com/financial-apis/) | US Securities | Frequency-specific, 1min | API-specific | OHLCV | Prices&Indicators | +| [IEXCloud](https://iexcloud.io/docs/api/) | NMS US securities | 1970-now, 1 day | 100 per second per IP | OHLCV | Prices&Indicators | +| [JoinQuant](https://www.joinquant.com/) | CN Securities | 2005-now, 1min | 3 requests each time | OHLCV | Prices&Indicators | +| [QuantConnect](https://www.quantconnect.com/docs/home/home) | US Securities | 1998-now, 1s | NA | OHLCV | Prices&Indicators | +| [RiceQuant](https://www.ricequant.com/doc/rqdata/python/) | CN Securities | 2005-now, 1ms | Account-specific | OHLCV | Prices&Indicators | +| [Sinopac](https://sinotrade.github.io/zh_TW/tutor/prepare/terms/) | Taiwan securities | 2023-04-13~now, 1min | Account-specific | OHLCV | Prices&Indicators | +| [Tushare](https://tushare.pro/document/1?doc_id=131) | CN Securities, A share | -now, 1 min | Account-specific | OHLCV | Prices&Indicators | +| [WRDS](https://wrds-www.wharton.upenn.edu/pages/about/data-vendors/nyse-trade-and-quote-taq/) | US Securities | 2003-now, 1ms | 5 requests each time | Intraday Trades | Prices&Indicators | +| [YahooFinance](https://pypi.org/project/yfinance/) | US Securities | Frequency-specific, 1min | 2,000/hour | OHLCV | Prices&Indicators | OHLCV: open, high, low, and close prices; volume. adjusted_close: adjusted close price @@ -174,14 +174,14 @@ We used the Deep Q-Learning based recommendation framework that considers curren
Click to view publications -| Title | Conference/Journal | Link | Citations | Year | -|-------|-------------------|------|-----------|------| -| Dynamic Datasets and Market Environments for Financial Reinforcement Learning | Machine Learning - Springer Nature | [paper](https://arxiv.org/abs/2304.13174) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 7 | 2024 | -| **FinRL-Meta**: FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning | NeurIPS 2022 | [paper](https://arxiv.org/abs/2211.03107) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 37 | 2022 | -| **FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949) | 49 | 2021 | -| **FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance | NeurIPS 2020 Deep RL Workshop | [paper](https://arxiv.org/abs/2011.09607) | 87 | 2020 | -| Deep reinforcement learning for automated stock trading: An ensemble strategy | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb) | 154 | 2020 | -| Practical deep reinforcement learning approach for stock trading | NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services | [paper](https://arxiv.org/abs/1811.07522) [code](https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading](https://github.com/AI4Finance-Foundation/FinRL/tree/master/examples)) | 164 | 2018 | +| Title | Conference/Journal | Link | Citations | Year | +| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ---- | +| Dynamic Datasets and Market Environments for Financial Reinforcement Learning | Machine Learning - Springer Nature | [paper](https://arxiv.org/abs/2304.13174) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 7 | 2024 | +| **FinRL-Meta**: FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning | NeurIPS 2022 | [paper](https://arxiv.org/abs/2211.03107) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta) | 37 | 2022 | +| **FinRL**: Deep reinforcement learning framework to automate trading in quantitative finance | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3955949) | 49 | 2021 | +| **FinRL**: A deep reinforcement learning library for automated stock trading in quantitative finance | NeurIPS 2020 Deep RL Workshop | [paper](https://arxiv.org/abs/2011.09607) | 87 | 2020 | +| Deep reinforcement learning for automated stock trading: An ensemble strategy | ACM International Conference on AI in Finance (ICAIF) | [paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996) [code](https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/2-Advance/FinRL_Ensemble_StockTrading_ICAIF_2020/FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb) | 154 | 2020 | +| Practical deep reinforcement learning approach for stock trading | NeurIPS 2018 Workshop on Challenges and Opportunities for AI in Financial Services | [paper](https://arxiv.org/abs/1811.07522) [code](https://github.com/AI4Finance-Foundation/DQN-DDPG_Stock_Trading](https://github.com/AI4Finance-Foundation/FinRL/tree/master/examples)) | 164 | 2018 |
diff --git a/py/lib/README.md b/py/lib/README.md index 515e189..e64748a 100644 --- a/py/lib/README.md +++ b/py/lib/README.md @@ -55,16 +55,16 @@ The Alpaca SDK will check the environment for a number of variables that can be Alternatively you could pass the credentials directly to the SDK instances. -| Environment | default | Description | -| -------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| APCA_API_KEY_ID= | | Your API Key | -| APCA_API_SECRET_KEY= | | Your API Secret Key | -| APCA_API_BASE_URL=url | https://api.alpaca.markets (for live) | Specify the URL for API calls, *Default is live, you must specify
https://paper-api.alpaca.markets to switch to paper endpoint!* | -| APCA_API_DATA_URL=url | https://data.alpaca.markets | Endpoint for data API | -| APCA_RETRY_MAX=3 | 3 | The number of subsequent API calls to retry on timeouts | -| APCA_RETRY_WAIT=3 | 3 | seconds to wait between each retry attempt | -| APCA_RETRY_CODES=429,504 | 429,504 | comma-separated HTTP status code for which retry is attempted | -| DATA_PROXY_WS | | When using the alpaca-proxy-agent you need to set this environment variable as described ![here](https://github.com/shlomikushchi/alpaca-proxy-agent) | +| Environment | default | Description | +| -------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| APCA_API_KEY_ID= | | Your API Key | +| APCA_API_SECRET_KEY= | | Your API Secret Key | +| APCA_API_BASE_URL=url | https://api.alpaca.markets (for live) | Specify the URL for API calls, *Default is live, you must specify
https://paper-api.alpaca.markets to switch to paper endpoint!* | +| APCA_API_DATA_URL=url | https://data.alpaca.markets | Endpoint for data API | +| APCA_RETRY_MAX=3 | 3 | The number of subsequent API calls to retry on timeouts | +| APCA_RETRY_WAIT=3 | 3 | seconds to wait between each retry attempt | +| APCA_RETRY_CODES=429,504 | 429,504 | comma-separated HTTP status code for which retry is attempted | +| DATA_PROXY_WS | | When using the alpaca-proxy-agent you need to set this environment variable as described ![here](https://github.com/shlomikushchi/alpaca-proxy-agent) | ## Working with Data ### Historic Data @@ -344,7 +344,7 @@ You can access the following information through this object. #### API REST Methods | Rest Method | End Point | Result | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------------------------------------------------------------------------------------------------| +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | get_account() | `GET /account` and | `Account` entity. | | get_order_by_client_order_id(client_order_id) | `GET /orders` with client_order_id | `Order` entity. | | list_orders(status=None, limit=None, after=None, until=None, direction=None, params=None,nested=None, symbols=None, side=None) | `GET /orders` | list of `Order` entities. `after` and `until` need to be string format, which you can obtain by `pd.Timestamp().isoformat()` | @@ -430,7 +430,7 @@ The base version of this library only allows running a single algorithm due to A The steps to execute this are: -* Run the Alpaca Proxy Agent as described in the project's README +* Run the Alpaca Proxy Agent as described in the project's OVERVIEW * Define a new environment variable: `DATA_PROXY_WS` set to the address of the proxy agent. (e.g: `DATA_PROXY_WS=ws://127.0.0.1:8765`) * If you are using the Alpaca data stream, make sure to initiate the Stream object with the container's url: `data_url='http://127.0.0.1:8765'` * Execute your algorithm. It will connect to the Alpaca servers through the proxy agent, allowing you to execute multiple strategies