Skip to content

Commit

Permalink
Fastquant Docs and Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aLca committed Oct 6, 2024
1 parent b59a620 commit b2fcc77
Show file tree
Hide file tree
Showing 40 changed files with 57,005 additions and 0 deletions.
Binary file added dependencies/fastquant/docs/assets/bbands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/fastquant/docs/assets/emac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/fastquant/docs/assets/macd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/fastquant/docs/assets/rsi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/fastquant/docs/assets/sentiment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dependencies/fastquant/docs/assets/smac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions dependencies/fastquant/docs/docusaurus/docs/backtest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
id: backtest
title: backtest
---

## Description

Backtest financial data with a specified trading strategy

## Parameters

**strategy** : str or an instance of `fastquant.strategies.base.BaseStrategy`
see list of accepted strategy keys below

**data** : pandas.DataFrame
dataframe with at least close price indexed with time

**commission** : float
commission per transaction [0, 1]

**init_cash** : float
initial cash (currency implied from `data`)

**plot** : bool
show plot backtrader (disabled if `strategy`=="multi")

**verbose** : int
Verbose can take values: [0, 1, 2, 3], with increasing levels of verbosity (default=1).

**sort_by** : str
sort result by given metric (default='rnorm')

**sentiments** : pandas.DataFrame
df of sentiment [0, 1] indexed by time (applicable if `strategy`=='senti')

**strats** : dict
dictionary of strategy parameters (applicable if `strategy`=='multi')

**return_history** : bool
return history of transactions (i.e. buy and sell timestamps) (default=False)

**channel** : str
Channel to be used for notifications - e.g. "slack" (default=None)

**symbol** : str
Symbol to be referenced in the channel notification if not None (default=None)

**allow_short** : bool
Whether to allow short selling, with max set as `short_max` times the portfolio value (default=False)

**short_max** : float
The maximum short position allowable as a ratio relative to the portfolio value at that timepoint(default=1.5)

**figsize** : tuple
The size of the figure to be displayed at the end of the backtest (default=(30, 15))

**data_class** : bt.feed.DataBase
Custom backtrader database to be used as a parent class instead bt.feed. (default=None)

**data_kwargs** : dict
Datafeed keyword arguments (empty dict by default)

## Returns

A plot containing the backtest results and a dictionary of the history and results of the backtest run.
25 changes: 25 additions & 0 deletions dependencies/fastquant/docs/docusaurus/docs/get_crypto_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
id: get_crypto_data
title: get_crypto_data
---

Get crypto data in OHLCV format

## Parameters

**ticker** : str
List of ticker symbols here: https://coinmarketcap.com/exchanges/binance/

**start_date**, **end_date** : str
date in YYYY-MM-DD format

**time_resolution** : str
resolutions: '1w', '1d' (default), '1h', '1m'

**exchange** : str
market exchanges: 'binance' (default), 'coinbasepro', 'bithumb', 'kraken', 'kucoin', 'bitstamp'

## Returns

**pandas.DataFrame**
Stock data (in the specified `format`) for the specified company and date range
29 changes: 29 additions & 0 deletions dependencies/fastquant/docs/docusaurus/docs/get_stock_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: get_stock_data
title: get_stock_data
---

## Parameters

**symbol** : str
Symbol of the stock in the PSE or Yahoo.
You can refer to these links:
PHISIX: https://www.pesobility.com/stock
YAHOO: https://www.nasdaq.com/market-activity/stocks/screener?exchange=nasdaq

**start_date** : str
Starting date (YYYY-MM-DD) of the period that you want to get data on

**end_date** : str
Ending date (YYYY-MM-DD) of the period you want to get data on

**source** : str
First source to query from ("pse", "yahoo"). If the stock is not found in the first source, the query is run on the other source.

**format** : str
Format of the output data

## Returns

**pandas.DataFrame**
Stock data (in the specified `format`) for the specified company and date range
Loading

0 comments on commit b2fcc77

Please sign in to comment.