Skip to content

Login

Login Shioaji

Simulation Accounts

If use simulation, we provide 10 of test accounts PAPIUSER01~PAPIUSER10, the password both 2222.

In

import shioaji as sj
api = sj.Shioaji()
api.login(
    person_id="YOUR_ID", 
    passwd="YOUR_PASSWORD", 
    contracts_cb=lambda security_type: print(f"{repr(security_type)} fetch done.")
)
import shioaji as sj
api = sj.Shioaji(simulation=True) 
api.login(
    person_id="PAPIUSER01", 
    passwd="2222", 
    contracts_cb=lambda security_type: print(f"{repr(security_type)} fetch done.")

Out

[FutureAccount(person_id='', broker_id='', account_id='', signed=True, username=''),
    StockAccount(person_id='', broker_id='', account_id='', signed=True, username='')]
<SecurityType.Index: 'IND'> fetch done.
<SecurityType.Future: 'FUT'> fetch done.
<SecurityType.Option: 'OPT'> fetch done.
<SecurityType.Stock: 'STK'> fetch done.