Python

Models

Các model dữ liệu trả về trong Python SDK

Tất cả model import từ ssi_sdk.models:

from ssi_sdk.models import Account, OHLCData, PlaceOrderResponse, TradeMessage

Authentication

Token

TrườngKiểuMô tả
access_tokenstrToken truy cập
token_typestrLoại token (mặc định "Bearer")
expires_atintThời điểm hết hạn (timestamp)
refresh_tokenstrToken làm mới
refresh_token_expires_atintThời điểm refresh token hết hạn

Account

Account

TrườngKiểuMô tả
account_nostrSố tài khoản
account_typeAccountTypeLoại tài khoản

Market Data

OHLCData

TrườngKiểuMô tả
symbolstrMã chứng khoán
trading_datestrNgày giao dịch
open_pricefloat | intGiá mở cửa
high_pricefloat | intGiá cao nhất
low_pricefloat | intGiá thấp nhất
close_pricefloat | intGiá đóng cửa
volumeintKhối lượng
valuefloat | intGiá trị giao dịch

MarketIndexes

TrườngKiểuMô tả
indexstrMã chỉ số
index_namestrTên chỉ số
boardBoard | NoneSàn

MarketIndexSummary

TrườngKiểuMô tả
indexstrMã chỉ số
boardstrSàn
trading_datestrNgày giao dịch
index_valuefloatGiá trị chỉ số
index_changefloatThay đổi
index_change_percentfloatThay đổi (%)
total_tradeintTổng KL giao dịch
total_trade_valuefloatTổng giá trị giao dịch
total_advance_stockintSố mã tăng
total_decline_stockintSố mã giảm
total_steady_stockintSố mã đứng

SecuritiesInfo

TrườngKiểuMô tả
symbolstrMã chứng khoán
boardBoard | NoneSàn
indexstr | NoneChỉ số
symbol_name_vistr | NoneTên tiếng Việt
symbol_name_enstr | NoneTên tiếng Anh
lot_sizeint | NoneLô giao dịch
listed_sharesint | NoneSố CP niêm yết
icb_codestr | NoneMã ngành ICB
icb_namestr | NoneTên ngành ICB

SecuritiesSummary

TrườngKiểuMô tả
symbolstrMã chứng khoán
trading_datestrNgày giao dịch
price_changefloatThay đổi giá
price_change_percentfloatThay đổi giá (%)
open_pricefloatGiá mở cửa
high_pricefloatGiá cao nhất
low_pricefloatGiá thấp nhất
close_pricefloatGiá đóng cửa
total_matchintTổng KL khớp
total_match_valuefloatTổng giá trị khớp

Portfolio

EquityAccountBalance

Các trường chính: account_no, available_cash, total_debt, withdrawal, on_hold_cash, sell_t0/sell_t1/sell_t2, buy_t0/buy_t1/buy_t2, bank_balance, block_cash, limit_t0, term_deposit.

DerivativeAccountBalance

Các trường chính: account_no, account_balance, fee, commission, interest, loan, floating_pl, trading_pl, total_pl, withdrawable, cash_ssi, cash_vsdc.

EquityPosition

TrườngKiểuMô tả
account_nostrSố tài khoản
symbolstrMã chứng khoán
quantityintTổng số lượng
sellable_quantityintSố lượng bán được
cost_pricefloatGiá vốn
buying_quantityintSL đang mua
selling_quantityintSL đang bán
mortgage_quantityintSL cầm cố

DerivativePosition

TrườngKiểuMô tả
account_nostrSố tài khoản
symbolstrMã hợp đồng
long / short / netintVị thế mua / bán / ròng
bid_avg_price / ask_avg_pricefloatGiá TB mua / bán
floating_pl / trading_plfloatLãi/lỗ

Order

TrườngKiểuMô tả
account_nostrSố tài khoản
client_request_idstrID yêu cầu client
order_idstrID lệnh
symbolstrMã chứng khoán
sideOrderSideMua/Bán
order_typeOrderTypeLoại lệnh
price / avg_pricefloatGiá đặt / Giá TB khớp
quantityintSL đặt
os_quantityintSL chờ
filled_quantityintSL đã khớp
cancel_quantityintSL đã huỷ
statusOrderStatusTrạng thái lệnh
input_time / modify_timestrThời gian đặt / sửa
messagestrThông báo

Trading Responses

PlaceOrderResponse

order_id, client_request_id, status

ModifyOrderResponse

client_modify_id, order_id, client_request_id, status

CancelOrderResponse

client_cancel_id, order_id, client_request_id, status

MaxBuySellResponse

account_no, symbol, max_buy_quantity, max_sell_quantity, margin_ratio, purchase_power

Streaming Messages

TradeMessage

type, trading_time, symbol, price, quantity, side, total_volume

IntervalMessage

type, interval_time, trading_time, symbol, open, high, low, close, volume

QuoteMessage

type, trading_time, symbol, bid_prices, bid_volumes, ask_prices, ask_volumes

ForeignRoomMessage

type, trading_time, symbol, total_room, current_room, buy_quantity, buy_value, sell_quantity, sell_value

PutMessage

type, trading_time, symbol, price, quantity, total_quantity, total_value

OddLotMessage

type, trading_time, symbol, price, quantity, bid_prices, bid_volumes, ask_prices, ask_volumes

MarketStatusMessage

market, status, trading_date

OrderStatusMessage

type, account_no, client_request_id, order_id, symbol, side, order_type, price, quantity, os_quantity, filled_quantity, cancel_quantity, status, input_time, modify_time, message

PortfolioMessage

type, account_no, total_asset, cash_balance, stock_value

HeartbeatMessage

method, channel, status, message

Trên trang này