Skip to main content

登入

login

輸入參數

參數類別說明
personal_idString登入的ID
passwordString登入的密碼
cert_pathString憑證路徑
cert_passString憑證密碼

帳號資訊 Account 欄位

Return type: Object

參數類別說明
branch_nameString分公司名
accountString分公司代號 + 帳號
account_typeString帳號類型 回傳 stk 證券
nameString姓名
s_markString現股當沖狀態 : B 可先賣後買與先買後賣、 YA 可先買後賣、其餘回傳未符合資格

請求範例

from masterlink_sdk import MasterlinkSDK, Order, BSAction, TimeInForce, OrderType, PriceType, MarketType

sdk = MasterLinkSDK()

accounts = sdk.login("您的身分證字號", "您的登入密碼", "您的憑證位置") # 若是使用技術文件申請,則憑證密碼為預設
#accounts = sdk.login("您的身分證字號", "您的登入密碼", "您的憑證位置", "您的憑證密碼") # 若使用憑證 e 管家,則需輸入自設憑證密碼

print(accounts) #若有多帳號,則回傳多個

回傳範例

[Account {
branch_name :"桃園",
account: "592v980000",
account_type: "stk",
s_mark: "N",
name: "許"
}, Account {
branch_name :"營業部",
account: "5920981100",
account_type: "stk",
s_mark: "N",
name: "許"
}, Account {
branch_name :"松德",
account: "592a980222",
account_type: "stk",
s_mark: "N",
name: "許"
}]