Skip to content

Commit

Permalink
docs: Update guide (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Skender <[email protected]>
  • Loading branch information
DaveSkender authored Apr 5, 2024
1 parent d549b60 commit 35a35a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/pages/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ There are many places to get stock market data. Check with your brokerage or ot
### How much historical quote data do I need?
Each indicator will need different amounts of price `quotes` to calculate. You can find guidance on the individual indicator documentation pages for minimum requirements; however, **most use cases will require that you provide more than the minimum**. As a general rule of thumb, you will be safe if you provide 750 points of historical quote data (e.g. 3 years of daily data). A `BadQuotesException` will be thrown if you do not provide sufficient historical quotes to produce any results.
Each indicator will need different amounts of price `quotes` to calculate. You can find guidance on the individual indicator documentation pages for minimum requirements; however, **most use cases will require that you provide more than the minimum**. As a general rule of thumb, you will be safe if you provide 750 points of historical quote data (e.g. 3 years of daily data).
>&#128681; IMPORTANT! Some indicators use a smoothing technique that converges to better precision over time. While you can calculate these with the minimum amount of quote data, the precision to two decimal points often requires 250 or more preceding historical records.
For example, if you are using daily data and want one year of precise EMA(250) data, you need to provide 3 years of historical quotes (1 extra year for the lookback period and 1 extra year for convergence); thereafter, you would discard or not use the first two years of results. Occassionally, even more is required for optimal precision.
> &#128681; **IMPORTANT! Applying the _minimum_ amount of quote history as possible is NOT a good way to optimize your system.** Some indicators use a smoothing technique that converges to better precision over time. While you can calculate these with the minimum amount of quote data, the precision to two decimal points often requires 250 or more preceding historical records.
>
> For example, if you are using daily data and want one year of precise EMA(250) data, you need to provide 3 years of historical quotes (1 extra year for the lookback period and 1 extra year for convergence); thereafter, you would discard or not use the first two years of results. Occasionally, even more is required for optimal precision.
### Using pandas.DataFrame
If you are using `pandas.DataFrame` to hold quote data, you have to convert it into an iterable `Quote` list. Here's [an efficient way](https://towardsdatascience.com/efficiently-iterating-over-rows-in-a-pandas-dataframe-7dd5f9992c01) to iterate `Dataframe` using _list comprehension_.
If you are using `pandas.DataFrame` to hold quote data, you have to convert it into an iterable `Quote` list. Here's [an efficient way](https://towardsdatascience.com/efficiently-iterating-over-rows-in-a-pandas-dataframe-7dd5f9992c01) to iterate `DataFrame` using _list comprehension_.
```python
# Suppose that you have dataframe like the below.
Expand Down

0 comments on commit 35a35a0

Please sign in to comment.