Vnstock Logo

Thống kê giao dịch

Cập nhật lần cuối:

Thảo luận



Phân tích kỹ thuật

Giới thiệu

Dữ liệu giá lịch sử và intraday dưới đây được trình duyệt Data Explorer kết nối tới nguồn dữ liệu VNDirect, giúp bạn bổ sung thêm nguồn dữ liệu dự phòng khi truy xuất lịch sử giá và khớp lệnh bên cạnh [dữ liệu sẵn có](http://localhost:3000/docs/huong-dan/thong-ke-gia-lich-su) từ nguồn VCI và TCBS của Vnstock trong gói sản phẩm cộng đồng. Ngoài ra nguồn dữ liệu này có thêm nhiều ưu việt về các loại dữ liệu có thể truy xuất như chỉ số ngành, tốc độ tải và khung thời gian truy xuất dữ liệu với độ chi tiết tốt hơn.

Khởi tạo đối tượng

from vnstock_data import Quote
quote = Quote(symbol='REE', source='vnd')

Tham số:

  • symbol: mã chứng khoán, nhập mã hợp lệ trong danh sách dưới đây.

Danh sách các loại chứng khoán được hỗ trợ:

  • Cổ phiếu: xem tại mục Liệt kê tất cả mã cổ phiếu
  • Chỉ số: VNINDEXHNXINDEXUPCOMINDEXVN30, VN100HNX30, VNSML (VNSMALLCAP), VNMID (VNMIDCAP), VNALL (VNALLSHARE)
  • Chỉ số ngành:
    • VNREAL: Bất động sản
    • VNMAT: Nguyên vật liệu
    • VNIT: Công nghệ thông tin
    • VNHEAL: Chăm sóc sức khoẻ
    • VNFINSELECT: Ngành tài chính chọn lọc
    • VNFIN: Tài chính
    • VNENE: Năng lượng
    • VNDIAMOND: VN Diamond là chứng chỉ quỹ dựa trên cơ sở tham chiếu cho các quỹ ETF. VN Diamond gồm tập hợp những cổ phiếu thuộc hàng top của thị trường chứng khoán Việt Nam.
    • VNCONS: Hàng tiêu dùng thiết yếu
    • VNCOND: Hàng tiêu dùng
  • Hợp đồng tương lai: Chấp nhận cả hai kiểu nhập tên làVN30F1M và VN30F2411
  • Chứng quyềnCFPT2314
  • Trái phiếu: Không hỗ trợ
  • Chứng chỉ quỹ - ETF: Tra cứu như với mã cổ phiếu, ví dụ E1VFVN30

OHLCV

Dữ liệu giá lịch sử đã điều chỉnh của một cổ phiếu được chọn, dữ liệu này thường được biểu diễn với đồ thị kỹ thuật.

Gọi hàm

quote.history(start='2000-07-28', end='2024-08-31', interval='1D')

Tham số

  • start: Ngày kết thúc của truy vấn dữ liệu lịch sử. Định dạng YYYY-mm-dd
  • end: Ngày kết thúc của truy vấn dữ liệu lịch sử. Định dạng YYYY-mm-dd
  • interval: Khung thời gian lấy mẫu dữ liệu. Mặc định là 1D cho phép trả về dữ liệu lịch sử theo ngày. Giới hạn thời gian truy xuất dữ liệu tối đa là 3 năm cho các khung thời gian phút, 11 năm cho khung thời gian từ ngày trở lên. Các giá trị hỗ trợ bao gồm:
    • 1m: 1 phút.
    • 5m: 5 phút
    • 15m: 15 phút
    • 30m: 30 phút
    • 1H: 1 giờ
    • 1W: 1 tuần
    • 1M: 1 tháng

Dữ liệu mẫu:

>>> quote.history(start='2000-07-28', end='2024-08-31', interval='1D')

           time   close    open    high     low   volume
0    2013-01-02   6.142   6.070   6.178   6.070   421680
1    2013-01-03   6.070   6.106   6.178   6.034   624970
2    2013-01-04   6.142   6.070   6.178   6.034   314290
3    2013-01-07   6.178   6.142   6.286   6.142   497270
4    2013-01-08   6.467   6.142   6.467   6.142  1872200
...         ...     ...     ...     ...     ...      ...
2904 2024-08-26  70.000  71.300  71.600  69.400   676600
2905 2024-08-27  68.600  69.600  70.000  68.400   692400
2906 2024-08-28  68.600  68.700  69.000  68.200   530200
2907 2024-08-29  69.000  68.500  69.000  68.400   328800
2908 2024-08-30  68.600  68.700  69.200  68.500   342100

[2909 rows x 6 columns]
Kiểu dữ liệu
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2909 entries, 0 to 2908
Data columns (total 6 columns):
 #   Column  Non-Null Count  Dtype         
---  ------  --------------  -----         
 0   time    2909 non-null   datetime64[ns]
 1   close   2909 non-null   float64       
 2   open    2909 non-null   float64       
 3   high    2909 non-null   float64       
 4   low     2909 non-null   float64       
 5   volume  2909 non-null   int64         
dtypes: datetime64[ns](1), float64(4), int64(1)

Intraday

Truy xuất dữ liệu khớp lệnh chứng khoán cho ngày giao dịch gần nhất.

Gọi hàm

quote.intraday()

Dữ liệu mẫu:

>>> quote.intraday()

                   time  price  accumulated_val  accumulated_vol  volume match_type
0   2024-11-08 09:15:01   64.9       1317470000            20300   20300        ATO
1   2024-11-08 09:15:43   64.9       1336940000            20600     300       Sell
2   2024-11-08 09:16:29   64.9       1369390000            21100     500       Sell
3   2024-11-08 09:18:21   64.7       1375860000            21200     100       Sell
4   2024-11-08 09:18:44   64.8       1382340000            21300     100       Sell
..                  ...    ...              ...              ...     ...        ...
655 2024-11-08 14:29:28   64.6      42922310000           664900     400        Buy
656 2024-11-08 14:29:28   64.6      42896470000           664500     500        Buy
657 2024-11-08 14:29:40   64.6      42948150000           665300     200        Buy
658 2024-11-08 14:29:40   64.6      42935230000           665100     200        Buy
659 2024-11-08 14:45:02   64.6      45234990000           700700   35400        ATC

[660 rows x 6 columns]
Kiểu dữ liệu
Data columns (total 6 columns):
 #   Column           Non-Null Count  Dtype         
---  ------           --------------  -----         
 0   time             660 non-null    datetime64[ns]
 1   price            660 non-null    float64       
 2   accumulated_val  660 non-null    int64         
 3   accumulated_vol  660 non-null    int64         
 4   volume           660 non-null    int64         
 5   match_type       660 non-null    object        
dtypes: datetime64[ns](1), float64(1), int64(3), object(1)

Thống kê giao dịch

Nguồn VCI

Thông tin

Nguồn dữ liệu thống kê giao dịch từ VCI bắt đầu hỗ trợ chính thức từ phiên bản 2.1.2

Khởi tạo đối tượng

Bạn cần chạy lệnh dưới đây để khai báo và khởi tạo đối tượng trading - biến sẽ được dùng để gọi hàm trong các bước tiếp theo.

from vnstock_data import Trading
trading = Trading(symbol='MSN', source='vci')
START_DATE = '2024-08-01'
END_DATE = '2024-08-16'

Bảng giá

Gọi hàm

trading.price_board(['VCB','ACB','TCB','BID'], flatten_columns=True, drop_levels=[0])

Tham số

  • symbol_list (list): Danh sách các mã chứng khoán, ví dụ ['VCB','ACB','TCB','BID']
  • flatten_columns (bool): Có loại bỏ index phân cấp hay không, sử dụng kết hợp với drop_levels. Giá trị mặc định là False để giữ nguyên index phân cấp.
  • drop_levels (list): Danh sách các cấp index cần loại bỏ, ví dụ [0].

Dữ liệu mẫu:

>>> trading.price_board(['VCB','ACB','TCB','BID'], flatten_columns=True, drop_levels=[0])

>>> print(trading.price_board(['VCB','ACB','TCB','BID'], flatten_columns=True, drop_levels=[0]))
  symbol  ceiling  floor  ref_price _stock_type exchange     trading_status  ... bid_3_volume ask_1_price  ask_1_volume ask_2_price ask_2_volume ask_3_price ask_3_volume
0    VCB    61000  53200      57100       STOCK      HSX  TRADING_ACTIVATED  ...        44200       57200           500       57300          400       57400         5200
1    ACB    25700  22400      24050       STOCK      HSX  TRADING_ACTIVATED  ...       255800       24050        137100       24100       230900       24150       460400
2    TCB    28350  24650      26500       STOCK      HSX  TRADING_ACTIVATED  ...       169300       26900        412200       26950       109200       27000       472500
3    BID    37250  32450      34850       STOCK      HSX  TRADING_ACTIVATED  ...          200       34950         49400       35000        71800       35050        11600

[4 rows x 61 columns]
Kiểu dữ liệu
Data columns (total 61 columns):
 #   Column                 Non-Null Count  Dtype  
---  ------                 --------------  -----  
 0   symbol                 4 non-null      object 
 1   ceiling                4 non-null      int64  
 2   floor                  4 non-null      int64  
 3   ref_price              4 non-null      int64  
 4   _stock_type            4 non-null      object 
 5   exchange               4 non-null      object 
 6   trading_status         4 non-null      object 
 7   security_status        4 non-null      object 
 8   last_trading_date      0 non-null      object 
 9   listed_share           4 non-null      int64  
 10  _sending_time          4 non-null      object 
 11  type                   4 non-null      object 
 12  organ_name             4 non-null      object 
 13  mapping_symbol         0 non-null      object 
 14  product_grp_id         4 non-null      object 
 15  _partition             4 non-null      int64  
 16  index_type             0 non-null      object 
 17  trading_date           4 non-null      object 
 18  lst_trading_status     0 non-null      object 
 19  transaction_time       4 non-null      object 
 20  accumulated_value      4 non-null      float64
 21  accumulated_volume     4 non-null      int64  
 22  accumulated_value_g1   4 non-null      float64
 23  accumulated_volume_g1  4 non-null      int64  
 24  avg_match_price        4 non-null      float64
 25  current_room           4 non-null      int64  
 26  foreign_buy_volume     4 non-null      int64  
 27  foreign_sell_volume    4 non-null      int64  
 28  foreign_buy_value      4 non-null      int64  
 29  foreign_sell_value     4 non-null      int64  
 30  highest                4 non-null      int64  
 31  lowest                 4 non-null      int64  
 32  match_price            4 non-null      int64  
 33  match_type             4 non-null      object 
 34  match_vol              4 non-null      int64  
 35  _sending_time          4 non-null      object 
 36  total_room             4 non-null      int64  
 37  total_buy_orders       4 non-null      int64  
 38  total_sell_orders      4 non-null      int64  
 39  bid_count              4 non-null      int64  
 40  ask_count              4 non-null      int64  
 41  underlying             0 non-null      object 
 42  open_interest          0 non-null      object 
 43  _stock_type            4 non-null      object 
 44  _partition             4 non-null      int64  
 45  is_match_price         4 non-null      bool   
 46  ceiling_price          4 non-null      int64  
 47  floor_price            4 non-null      int64  
 48  reference_price        4 non-null      int64  
 49  bid_1_price            4 non-null      int64  
 50  bid_1_volume           4 non-null      int64  
 51  bid_2_price            4 non-null      int64  
 52  bid_2_volume           4 non-null      int64  
 53  bid_3_price            4 non-null      int64  
 54  bid_3_volume           4 non-null      int64  
 55  ask_1_price            4 non-null      int64  
 56  ask_1_volume           4 non-null      int64  
 57  ask_2_price            4 non-null      int64  
 58  ask_2_volume           4 non-null      int64  
 59  ask_3_price            4 non-null      int64  
 60  ask_3_volume           4 non-null      int64  
dtypes: bool(1), float64(3), int64(37), object(20)

Thống kê đặt lệnh & nước ngoài

Gọi hàm

trading.price_history (start=START_DATE, end=END_DATE, resolution='1D')

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • resolution: Hỗ trợ tổng hợp theo ngày, tuần, tháng, quý, năm tương ứng với giá trị 1D, 1W, 1M, 1Q, 1Y

Dữ liệu mẫu:

>>> trading.price_history (start=START_DATE, end=END_DATE, resolution='1D')
   trading_date    market_cap  total_shares  ceiling_price  floor_price  ...  total_buy_unmatched_volume  total_sell_unmatched_volume  average_buy_trade_volume  average_sell_trade_volume  total_net_trade_volume
0    2025-05-30  2.585158e+13   718099480.0        38650.0      33650.0  ...                   4555140.0                    6769095.0               2600.095135                2683.972185              -2213955.0
1    2025-05-29  2.595930e+13   718099480.0        39100.0      34000.0  ...                   3571849.0                    4735689.0               2040.132054                4619.637438              -1163840.0
2    2025-05-28  2.624654e+13   718099480.0        39550.0      34450.0  ...                   3972864.0                    8182550.0               2376.301977                3323.570162              -4209686.0
3    2025-05-27  2.656968e+13   718099480.0        39550.0      34450.0  ...                   3065833.0                    6128452.0               2792.279813                2805.221207              -3062619.0
4    2025-05-26  2.656968e+13   718099480.0        38750.0      33750.0  ...                   4534013.0                    3147834.0               2188.055882                2787.048288               1386179.0
Kiểu dữ liệu
Data columns (total 59 columns):
 #   Column                         Non-Null Count  Dtype         
---  ------                         --------------  -----         
 0   trading_date                   100 non-null    datetime64[ns]
 1   market_cap                     100 non-null    float64       
 2   total_shares                   100 non-null    float64       
 3   ceiling_price                  100 non-null    float64       
 4   floor_price                    100 non-null    float64       
 5   reference_price                100 non-null    float64       
 6   open                           100 non-null    float64       
 7   close                          100 non-null    float64       
 8   match_price                    100 non-null    float64       
 9   price_change                   100 non-null    float64       
 10  percent_price_change           100 non-null    float64       
 11  high                           100 non-null    float64       
 12  low                            100 non-null    float64       
 13  average_price                  100 non-null    float64       
 14  matched_volume                 100 non-null    float64       
 15  matched_value                  100 non-null    float64       
 16  deal_volume                    100 non-null    float64       
 17  deal_value                     100 non-null    float64       
 18  total_volume                   100 non-null    float64       
 19  total_value                    100 non-null    float64       
 20  total_buy_trade                100 non-null    float64       
 21  total_buy_trade_volume         100 non-null    float64       
 22  total_sell_trade               100 non-null    float64       
 23  total_sell_trade_volume        100 non-null    float64       
 24  fr_buy_value_matched           100 non-null    float64       
 25  fr_buy_volume_matched          100 non-null    float64       
 26  fr_sell_value_matched          100 non-null    float64       
 27  fr_sell_volume_matched         100 non-null    float64       
 28  fr_buy_value_deal              100 non-null    float64       
 29  fr_buy_volume_deal             100 non-null    float64       
 30  fr_sell_value_deal             100 non-null    float64       
 31  fr_sell_volume_deal            100 non-null    float64       
 32  fr_buy_value_total             100 non-null    float64       
 33  fr_buy_volume_total            100 non-null    float64       
 34  fr_sell_value_total            100 non-null    float64       
 35  fr_sell_volume_total           100 non-null    float64       
 36  fr_total_room                  100 non-null    float64       
 37  fr_current_room                100 non-null    float64       
 38  reference_price_adjusted       100 non-null    float64       
 39  open_price_adjusted            100 non-null    float64       
 40  close_price_adjusted           100 non-null    float64       
 41  price_change_adjusted          100 non-null    float64       
 42  percent_price_change_adjusted  100 non-null    float64       
 43  highest_price_adjusted         100 non-null    float64       
 44  lowest_price_adjusted          100 non-null    float64       
 45  fr_available_percentage        100 non-null    float64       
 46  fr_room_percentage             100 non-null    float64       
 47  fr_net_volume_total            100 non-null    float64       
 48  fr_net_value_total             100 non-null    float64       
 49  fr_net_volume_matched          100 non-null    float64       
 50  fr_net_value_matched           100 non-null    float64       
 51  fr_net_volume_deal             100 non-null    float64       
 52  fr_net_value_deal              100 non-null    float64       
 53  fr_owned_percentage            100 non-null    float64       
 54  total_buy_unmatched_volume     100 non-null    float64       
 55  total_sell_unmatched_volume    100 non-null    float64       
 56  average_buy_trade_volume       100 non-null    float64       
 57  average_sell_trade_volume      100 non-null    float64       
 58  total_net_trade_volume         100 non-null    float64       
dtypes: datetime64[ns](1), float64(58)

Giao dịch tự doanh

Gọi hàm

trading.prop_trade (start=START_DATE, end=END_DATE, resolution='1D')

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • resolution: Hỗ trợ tổng hợp theo ngày, tuần, tháng, quý, năm tương ứng với giá trị 1D, 1W, 1M, 1Q, 1Y

Dữ liệu mẫu:

>>> trading.prop_trade (start=START_DATE, end=END_DATE, resolution='1D')
   trading_date  total_buy_trade_volume  percent_buy_trade_volume  total_buy_trade_value  percent_buy_trade_value  ...  total_deal_trade_net_volume  total_deal_trade_net_value              update_date  total_volume   total_value
0    2025-05-30                  4000.0                  0.000529           1.454800e+08                 0.000528  ...                          0.0                0.000000e+00  2025-05-30T17:03:35.373     7557098.0  2.755744e+11
1    2025-05-29                 16000.0                  0.002162           5.832000e+08                 0.002163  ...                          0.0                0.000000e+00  2025-05-29T16:53:43.727     7401620.0  2.695903e+11
2    2025-05-28                     0.0                  0.000000           0.000000e+00                 0.000000  ...                          0.0                0.000000e+00  2025-05-28T17:35:18.423    10951302.0  4.054848e+11
3    2025-05-27                125000.0                  0.016157           4.649250e+09                 0.016182  ...                          0.0                0.000000e+00   2025-05-27T17:13:19.92     7736652.0  2.873070e+11
4    2025-05-26                     0.0                  0.000000           0.000000e+00                 0.000000  ...                          0.0                0.000000e+00   2025-05-26T17:32:14.46     7760673.0  2.815145e+11
Kiểu dữ liệu
Data columns (total 26 columns):
 #   Column                         Non-Null Count  Dtype         
---  ------                         --------------  -----         
 0   trading_date                   100 non-null    datetime64[ns]
 1   total_buy_trade_volume         100 non-null    float64       
 2   percent_buy_trade_volume       100 non-null    float64       
 3   total_buy_trade_value          100 non-null    float64       
 4   percent_buy_trade_value        100 non-null    float64       
 5   total_sell_trade_volume        100 non-null    float64       
 6   percent_sell_trade_volume      100 non-null    float64       
 7   total_sell_trade_value         100 non-null    float64       
 8   percent_sell_trade_value       100 non-null    float64       
 9   total_trade_net_volume         100 non-null    float64       
 10  total_trade_net_value          100 non-null    float64       
 11  total_match_buy_trade_volume   100 non-null    float64       
 12  total_match_buy_trade_value    100 non-null    float64       
 13  total_match_sell_trade_volume  100 non-null    float64       
 14  total_match_sell_trade_value   100 non-null    float64       
 15  total_match_trade_net_volume   100 non-null    float64       
 16  total_match_trade_net_value    100 non-null    float64       
 17  total_deal_buy_trade_volume    100 non-null    float64       
 18  total_deal_buy_trade_value     100 non-null    float64       
 19  total_deal_sell_trade_volume   100 non-null    float64       
 20  total_deal_sell_trade_value    100 non-null    float64       
 21  total_deal_trade_net_volume    100 non-null    float64       
 22  total_deal_trade_net_value     100 non-null    float64       
 23  update_date                    100 non-null    object        
 24  total_volume                   100 non-null    float64       
 25  total_value                    100 non-null    float64       
dtypes: datetime64[ns](1), float64(24), object(1)

Giao dịch nội bộ

Gọi hàm

trading.insider_deal(lang='vi')

Tham số:

  • lang: Ngôn ngữ trả về, mặc định là vi cho tiếng Việt, giá trị khác là en cho tiếng Anh

Dữ liệu mẫu:

>>> trading.insider_deal(lang='vi')
   start_date   end_date             public_date  share_before_trade  share_after_trade  ...  action_type              trader_name                                trader_position         role_name     relative_name
0  2025-05-12 2025-05-12 2025-05-13 00:00:00.000             45000.0                0.0  ...          Bán                      NaN                                            NaN               NaN               NaN
1  2025-02-25 2025-03-25 2025-02-20 00:00:00.000                 0.0                0.0  ...          Mua                      NaN                                            NaN               NaN               NaN
2  2024-12-20 2025-01-17 2025-01-20 00:00:00.000            819000.0           251000.0  ...          Bán          Đoàn Minh Thiện  Phó Tổng Giám đốc/Phụ trách Công bố thông tin   Đoàn Minh Thiện   Đoàn Minh Thiện
3  2024-09-04 2024-09-11 2024-09-13 00:00:00.000          22838732.0          9638732.0  ...          Bán  Trương Nguyễn Thiên Kim                                            NaN        Vợ Tô  Hải           Tô  Hải
4  2024-07-30 2024-08-28 2024-08-29 00:00:00.000           3195320.0          1680120.0  ...          Bán         Nguyễn Quang Bảo                              Phó Tổng Giám đốc  Nguyễn Quang Bảo  Nguyễn Quang Bảo
Kiểu dữ liệu
 #   Column                 Non-Null Count  Dtype         
---  ------                 --------------  -----         
 0   start_date             75 non-null     datetime64[ns]
 1   end_date               75 non-null     datetime64[ns]
 2   public_date            75 non-null     datetime64[ns]
 3   share_before_trade     75 non-null     float64       
 4   share_after_trade      75 non-null     float64       
 5   share_register         75 non-null     float64       
 6   share_acquire          75 non-null     float64       
 7   ownership_after_trade  75 non-null     float64       
 8   trader_person_id       22 non-null     float64       
 9   event_name             75 non-null     object        
 10  source_url             75 non-null     object        
 11  trade_status           75 non-null     object        
 12  trader_organ_name      53 non-null     object        
 13  action_type            75 non-null     object        
 14  trader_name            22 non-null     object        
 15  trader_position        10 non-null     object        
 16  role_name              22 non-null     object        
 17  relative_name          22 non-null     object        
dtypes: datetime64[ns](3), float64(6), object(9)

Nguồn CafeF

Khởi tạo đối tượng

Bạn cần chạy lệnh dưới đây để khai báo và khởi tạo đối tượng trading - biến sẽ được dùng để gọi hàm trong các bước tiếp theo.

from vnstock_data import Trading
trading = Trading(symbol='MSN', source='cafef')
START_DATE = '2024-01-02'
END_DATE = '2024-11-08'

Lịch sử giao dịch

Truy xuất dữ liệu lịch sử giao dịch chưa điều chỉnh.

Gọi hàm

trading.price_history(start=START_DATE, end=END_DATE)

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15

Dữ liệu mẫu:

>>> trading.price_history(start=START_DATE, end=END_DATE)

            open  high   low  close  adjusted_price  change_pct  matched_volume  matched_value  deal_volume    deal_value
time                                                                                                                     
2024-08-16  75.4  77.5  75.2   77.3            77.3      0.0307         8146700   624175000000           39       2983500
2024-08-15  76.7  76.7  75.0   75.0            75.0     -0.0196         3319900   250972000000       155053   11597964400
2024-08-14  75.2  77.3  74.9   76.5            76.5      0.0227        10253700   785205000000           11        827200
2024-08-13  75.0  75.2  73.8   74.8            74.8     -0.0053         4760200   354087000000       155000   11594000000
2024-08-12  75.5  76.2  74.3   75.2            75.2      0.0000         4458500   335256000000            0             0
2024-08-09  74.6  75.3  74.5   75.2            75.2      0.0094         3965800   297022000000            0             0
2024-08-08  73.0  75.6  72.7   74.5            74.5      0.0205         9533100   711827000000            0             0
2024-08-07  73.3  73.5  72.2   73.0            73.0     -0.0027         3653400   266130000000      4876000  356849600000
2024-08-06  71.0  73.4  70.5   73.2            73.2      0.0383         5272100   380075000000       259000   18699800000
2024-08-05  71.3  72.7  70.2   70.5            70.5     -0.0235         6260600   444531000000        20000    1544000000
2024-08-02  71.0  73.2  71.0   72.2            72.2      0.0056         5314700   383544000000       259000   18699800000
2024-08-01  74.1  74.9  70.8   71.8            71.8     -0.0310         7659500   561882000000            0             0
Kiểu dữ liệu
DatetimeIndex: 12 entries, 2024-08-16 to 2024-08-01
Data columns (total 10 columns):
 #   Column          Non-Null Count  Dtype  
---  ------          --------------  -----  
 0   open            12 non-null     float64
 1   high            12 non-null     float64
 2   low             12 non-null     float64
 3   close           12 non-null     float64
 4   adjusted_price  12 non-null     float64
 5   change_pct      12 non-null     float64
 6   matched_volume  12 non-null     int64  
 7   matched_value   12 non-null     int64  
 8   deal_volume     12 non-null     int64  
 9   deal_value      12 non-null     int64  
dtypes: float64(6), int64(4)

Thống kê đặt lệnh

Truy xuất thông tin thống kê lịch sử đặt lệnh.

Gọi hàm

trading.order_stats(start=START_DATE, end=END_DATE)

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15

Dữ liệu mẫu:

>>> trading.order_stats(start=START_DATE, end=END_DATE)

Mã CK: MSN. Số bản ghi hợp lệ: 11
            buy_orders  sell_orders  buy_volume  sell_volume volume_diff  avg_buy_order_volume  avg_sell_order_volume
time                                                                                                                 
2024-08-16        6520         6883    13304200     14321700  -1,017,500               2040.52                   2081
2024-08-15        4771         3794     5750400      8095400  -2,345,000               1205.28                   2134
2024-08-14        7007        11031    23704400     20139000   3,565,400               3382.96                   1826
2024-08-13        6559         3650     8846800      8600300     246,500               1348.80                   2356
2024-08-12        5403         4727     8667000      9060700    -393,700               1604.11                   1917
2024-08-08        7018         9430    18987700     17592900   1,394,800               2705.57                   1866
2024-08-07        4375         5013     6947100      6589000     358,100               1587.91                   1314
2024-08-06        4557         5189     9752900      9474100     278,800               2140.20                   1826
2024-08-05        8693         4095    10187100     10429300    -242,200               1171.87                   2547
2024-08-02        6137         3851    11814700      9103100   2,711,600               1925.16                   2364
2024-08-01        7786         5423    13009600     13948900    -939,300               1670.90                   2572
Kiểu dữ liệu
Data columns (total 7 columns):
 #   Column                 Non-Null Count  Dtype  
---  ------                 --------------  -----  
 0   buy_orders             11 non-null     int64  
 1   sell_orders            11 non-null     int64  
 2   buy_volume             11 non-null     int64  
 3   sell_volume            11 non-null     int64  
 4   volume_diff            11 non-null     object 
 5   avg_buy_order_volume   11 non-null     float64
 6   avg_sell_order_volume  11 non-null     int64  
dtypes: float64(1), int64(5), object(1)

Giao dịch nước ngoài

Thống kê lịch sử giao dịch nước ngoài theo ngày.

Gọi hàm

trading.foreign_trade(start=START_DATE, end=END_DATE)

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15

Dữ liệu mẫu:

>>> trading.foreign_trade(start=START_DATE, end=END_DATE)

            fr_net_volume  fr_net_value  fr_buy_volume  fr_buy_value  fr_sell_volume  fr_sell_value  fr_remaining_room  fr_ownership
time                                                                                                                                
2024-08-16         819800   63190100000        1352500  103867230000          532700    40677130000          309182209         28.56
2024-08-15        -241800  -18319590000         188800   14299490000          430600    32619080000          310321038         28.49
2024-08-14        2855600  218659620000        3069200  235054510000          213600    16394890000          309878586         28.52
2024-08-13          59700    4541660000         684900   51044810000          625200    46503150000          312328492         28.36
2024-08-12        -275700  -20993260000         343500   25750980000          619200    46744240000          312345060         28.35
2024-08-09         472860   35386737800        1141200   85418280000          668340    50031542200          312368360         28.35
2024-08-08        1036300   77000610000        1392500  103700660000          356200    26700050000          312749186         28.33
2024-08-07        -436200  -31788990000         379100   27580810000          815300    59369800000          313847386         28.26
2024-08-06         582500   42572070000         876800   63640240000          294300    21068170000          313982629         28.25
2024-08-05         681200   48343730000         924900   65670630000          243700    17326900000          314436493         28.22
2024-08-02         848200   61147120000        1271100   91686810000          422900    30539690000          315126598         28.17
2024-08-01        1133200   83515230000        1368000  100646570000          234800    17131340000          315745298         28.13
Kiểu dữ liệu
Data columns (total 8 columns):
 #   Column             Non-Null Count  Dtype  
---  ------             --------------  -----  
 0   fr_net_volume      12 non-null     int64  
 1   fr_net_value       12 non-null     int64  
 2   fr_buy_volume      12 non-null     int64  
 3   fr_buy_value       12 non-null     int64  
 4   fr_sell_volume     12 non-null     int64  
 5   fr_sell_value      12 non-null     int64  
 6   fr_remaining_room  12 non-null     int64  
 7   fr_ownership       12 non-null     float64
dtypes: float64(1), int64(7)

Giao dịch tự doanh

Gọi hàm

trading.prop_trade(start=START_DATE, end=END_DATE)

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15

Dữ liệu mẫu:

>>> trading.prop_trade(start=START_DATE, end=END_DATE)

            prop_buy_volume  prop_sell_volume  prop_buy_value  prop_sell_value
time                                                                          
2024-08-16           308300            631400     23701000000      48405990000
2024-08-15           151500            144200     11463000000      10915430000
2024-08-14           189000            373600     14503110000      28500230000
2024-08-13           321600            114400     23882040000       8534700000
2024-08-12           149700            242200     11233030000      18232480000
2024-08-09            95000             91700      7103840000       6865100000
2024-08-08           158600            617200     11838100000      46065230000
2024-08-07            64900            284400      4718110000      20741850000
2024-08-06           509800            185000     36493820000      13408000000
2024-08-05           161300            767500     11444560000      54692540000
2024-08-02           129000            328900      9323420000      23729710000
2024-08-01           634000            277400     46819530000      20285700000
Kiểu dữ liệu
Data columns (total 4 columns):
 #   Column            Non-Null Count  Dtype
---  ------            --------------  -----
 0   prop_buy_volume   12 non-null     int64
 1   prop_sell_volume  12 non-null     int64
 2   prop_buy_value    12 non-null     int64
 3   prop_sell_value   12 non-null     int64
dtypes: int64(4)

Giao dịch nội bộ

Gọi hàm

trading.insider_deal(start='2024-01-02', end=END_DATE)

Tham số

  • start: Ngày bắt đầu truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15
  • end: Ngày kết thúc truy xuất báo cáo, định dạng YYYY-mm-dd ví dụ 2024-08-15

Dữ liệu mẫu:

>>> trading.insider_deal(start='2024-01-02', end=END_DATE)

  symbol holder_id              transaction_man transaction_man_position related_man_position  ...          order_date  volume_after_transaction  transaction_note  shareholder_code ownership_percentage
0    MSN         0              Trần Phương Bắc        Công bố thông tin                       ... 2024-06-17 17:00:00                         0                           CEO_80830             0.000000
1    MSN         0                     Danny Le            Tổng Giám đốc                       ... 2024-06-17 17:00:00                         0                           CEO_36172             0.000000
2    MSN         0              Nguyễn Huy Hùng           Kế toán trưởng                       ... 2024-06-17 17:00:00                         0                          CEO_871208             0.000000
3    MSN         0            Đoàn Thị Mỹ Duyên       Giám đốc Tài chính                       ... 2024-06-17 17:00:00                         0                           CEO_30750             0.000000
4    MSN         0          Michael Hung Nguyen       Giám đốc Tài chính                       ... 2024-06-17 17:00:00                         0                           CEO_70174             0.000000
5    MSN         0  GIC/Government of Singapore                                                ... 2024-03-12 17:00:00                  31642924                        GICSINGAPORE             2.199944

[6 rows x 20 columns]
Kiểu dữ liệu
Data columns (total 20 columns):
 #   Column                     Non-Null Count  Dtype         
---  ------                     --------------  -----         
 0   symbol                     6 non-null      object        
 1   holder_id                  6 non-null      object        
 2   transaction_man            6 non-null      object        
 3   transaction_man_position   6 non-null      object        
 4   related_man_position       6 non-null      object        
 5   related_man                6 non-null      object        
 6   volume_before_transaction  6 non-null      int64         
 7   plan_buy_volume            6 non-null      int64         
 8   plan_sell_volume           6 non-null      int64         
 9   plan_begin_date            5 non-null      datetime64[ns]
 10  plan_end_date              5 non-null      datetime64[ns]
 11  real_buy_volume            6 non-null      int64         
 12  real_sell_volume           6 non-null      int64         
 13  real_end_date              1 non-null      datetime64[ns]
 14  published_date             6 non-null      datetime64[ns]
 15  order_date                 6 non-null      datetime64[ns]
 16  volume_after_transaction   6 non-null      int64         
 17  transaction_note           6 non-null      object        
 18  shareholder_code           6 non-null      object        
 19  ownership_percentage       6 non-null      float64       
dtypes: datetime64[ns](5), float64(1), int64(6), object(8)

Thảo luận

Đang tải bình luận...