Skip to content

Commit

Permalink
fix: 馃悰 remove date parameters for best/worst performers
Browse files Browse the repository at this point in the history
  • Loading branch information
imadarchid committed Jun 24, 2022
1 parent 5796ee8 commit 63cc07c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ $ pip install StocksMA
- [Get price data of multiple companies](#get-price-data)
- [Get price data of single company](#get-price-data)
- [Get session information](#get-session-information)
- [Session performance](#get-session-performance)
- [Get best performers for a given session](#get-session-performance)
- [Get worst performers for a given session](#get-session-performance)
- [Current Session performance](#get-session-performance)
- [Get best performers for the current session](#get-session-performance)
- [Get worst performers for the current session](#get-session-performance)
- [Get intraday price data](#get-intraday-price-data)
- [Get Ask Bid data](#get-ask-bid-data)
- [Get balance sheet](#get-balance-sheet)
Expand Down Expand Up @@ -170,18 +170,15 @@ stm.get_session_info('involys')

---

### Get session performance
Get a session's best performing indices

**Args**:
- **`date`** `str`: Session date (e.g: 2022-6-24-13:40)
### Get the current session performance
Get the current session's best performing indices

**Returns**:
- **`pd.DataFrame`**: Dataframe of the best performing indices, their current price, and the variation of their price

**Example:**
```python
stm.get_best_performers('2022-6-24-13:40')
stm.get_best_performers()
```
| | Name | Price | Variation |
|---:|:------------------|--------:|------------:|
Expand All @@ -201,17 +198,14 @@ stm.get_best_performers('2022-6-24-13:40')
| 13 | Managem P | 2200 | 0.05 |
| 14 | Lesieur Cristal | 180 | 0 |

Get a session's worst performing indices

**Args**:
- **`date`** `str`: Session date (e.g: 2022-6-24-13:40)
Get the current session's worst performing indices

**Returns**:
- **`pd.DataFrame`**: Dataframe of the worst performing indices, their current price, and the variation of their price

**Example:**
```python
stm.get_worst_performers('2022-6-24-13:40')
stm.get_worst_performers()
```

| | Name | Price | Variation |
Expand Down
16 changes: 4 additions & 12 deletions StocksMA/StocksMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,19 +648,15 @@ def get_sector_intraday(sector: str) -> pd.DataFrame:

return data

def get_best_performers(date: str) -> pd.DataFrame:
def get_best_performers() -> pd.DataFrame:
"""Get best performers for a given session
Args:
date (str): date string e.g: 2022-6-24-13:40
Returns:
pd.DataFrame: Dataframe of the best performing indices, their current price, and their variation
"""

url = (
"https://medias24.com/content/api?method=getBestPerformers&format=json&t="
+ date
"https://medias24.com/content/api?method=getBestPerformers&format=json"
)
request_data = utils.get_request(url)

Expand All @@ -671,18 +667,14 @@ def get_best_performers(date: str) -> pd.DataFrame:
return data


def get_worst_performers(date: str) -> pd.DataFrame:
def get_worst_performers() -> pd.DataFrame:
"""Get worst performers for a given session
Args:
date (str): date string e.g: 2022-6-24-13:40
Returns:
pd.DataFrame: Dataframe of the worst performing indices, their current price, and their variation
"""
url = (
"https://medias24.com/content/api?method=getWorstPerformers&format=json&t="
+ date
"https://medias24.com/content/api?method=getWorstPerformers&format=json"
)
request_data = utils.get_request(url)

Expand Down

0 comments on commit 63cc07c

Please sign in to comment.