Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rochi88 committed Dec 31, 2024
1 parent f36bb85 commit 77850c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ print(df.to_string())
```
or
```python
import datetime as dt
from bdshare import get_basic_hist_data

df = get_basic_hist_data('2022-03-01','2022-03-02','GP') # get specific instrument data
start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_basic_hist_data(start, end, 'GP') # get specific instrument data
print(df.to_string())
```

Expand Down Expand Up @@ -99,9 +102,12 @@ print(df.to_string())

#### Save data to csv file
```python
import datetime as dt
from bdshare import get_basic_hist_data, Store

df = get_basic_hist_data('2022-03-01','2022-03-02') # get all instrument data
start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_basic_hist_data(start, end) # get all instrument data
Store(df).save()
```

Expand Down
6 changes: 4 additions & 2 deletions tests/test_trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ def test_get_current_trade_data(self):
print(df.to_string())

def test_get_market_inf_more_data(self):
start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_market_inf_more_data('2020-01-01', end, index='date')
df = get_market_inf_more_data(start, end, index='date')
print(df.to_string())
print(df.dtypes)

def test_get_basic_hist_data(self):
start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_basic_hist_data('2020-01-01', end, 'BATBC')
df = get_basic_hist_data(start, end, 'BATBC')
print(df.to_string())
print(df.dtypes)

Expand Down

0 comments on commit 77850c1

Please sign in to comment.