0
# Stock Screening
1
2
The Screener class provides advanced stock filtering and screening capabilities using TCBS data source with customizable parameters and criteria for Vietnamese stock market analysis.
3
4
## Capabilities
5
6
### Screener Class
7
8
API adapter for stock screening functionality with advanced filtering capabilities.
9
10
```python { .api }
11
class Screener:
12
"""
13
Stock screener adapter for filtering and analysis.
14
15
Supported sources: TCBS only
16
"""
17
18
SUPPORTED_SOURCES = ["tcbs"]
19
20
def __init__(self, source: str = "tcbs", random_agent: bool = False, show_log: bool = False):
21
"""
22
Initialize Screener adapter.
23
24
Args:
25
source (str): Data source ("tcbs"), defaults to "tcbs"
26
random_agent (bool): Use random user agent, defaults to False
27
show_log (bool): Enable logging, defaults to False
28
"""
29
```
30
31
### Stock Screening
32
33
Filter stocks based on various financial and technical criteria.
34
35
```python { .api }
36
def stock(self, params: dict = None, limit: int = 50, id: str = None, lang: str = "vi") -> pd.DataFrame:
37
"""
38
Screen stocks using customizable filtering parameters.
39
40
Args:
41
params (dict): Screening parameters and criteria
42
limit (int): Maximum number of results, defaults to 50
43
id (str): Screen configuration ID, defaults to None
44
lang (str): Language ("vi", "en"), defaults to "vi"
45
46
Returns:
47
pd.DataFrame: Filtered stock results with screening metrics
48
"""
49
```
50
51
## Usage Examples
52
53
```python
54
from vnstock import Screener
55
56
# Initialize screener
57
screener = Screener(source="tcbs")
58
59
# Basic stock screening
60
results = screener.stock(limit=20, lang="vi")
61
62
# Advanced screening with parameters
63
filtered_stocks = screener.stock(
64
params={
65
"marketCap": {"min": 1000000000, "max": 10000000000},
66
"pe": {"min": 5, "max": 25},
67
"roe": {"min": 10}
68
},
69
limit=30
70
)
71
72
# Screening with specific criteria
73
value_stocks = screener.stock(
74
params={"pb": {"max": 1.5}, "pe": {"max": 15}},
75
limit=25,
76
lang="en"
77
)
78
```