Metadata-Version: 2.1
Name: pandasbt
Version: 0.2.0
Summary: Simple framework to test your strategies ideias with pandas
Home-page: https://github.com/Janderson/pandasbt
Author: Janderson FFerreira
Author-email: ffjanderson@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# PandasBT
Simples Framework to Backtest Strategies using pandas

#### Installation
----------
```
pip install pandasbt
```


#### Calculation a factor zscore
```python
import pandasbt as pbt

df_test = pd.DataFrame([
    {"close": 25}, {"close": 15}, {"close": 41}, {"close": 7},
    {"close": 5}, {"close": 115}, {"close": 45}, {"close": 32},
])

pbt.zscore(df_test, period=20)
```
or you can specify the column
```python
pbt.zscore(df_test, 20, "close")
```


#### Calculation Buy and Sell signals
That mean add a signal column into dataframe.  
0 - means nothing  
-1 - means sell  
1 - means buy  

```python
import pandasbt as pbt

df_test = pd.DataFrame([
    {"close": 25}, {"close": 15}, {"close": 41}, {"close": 7},
    {"close": 5}, {"close": 115}, {"close": 45}, {"close": 32},
])

pbt.calc_signal(df_test, buy_query="close > 20", sell_query="close < 10")
```


