Skip to main content

Quick Start

Please refer to the Preparation first and complete the application for the API Agreements and certificate download。

If you haven't installed the SDK package yet, you can download it from SDK download page. Once you have the SDK package and know the installation path, use the following command to install it:"

Install Package

pip install fubon_neo-<version>-cp37-abi3-win_amd64.whl

And you should place the certificate in your folder structure like this:

.
└── XXXXXXXXXX.pfx

f you have never used the SDK for logging in or if you have changed your SDK execution environment, please create an index.py file in your folder and paste the following content into it, then execute it::

from fubon_neo.sdk import FubonSDK, Order
from fubon_neo.constant import TimeInForce, OrderType, PriceType, MarketType, BSAction

sdk = FubonSDK()

accounts = sdk.login("Your ID", "Your Password", "Your cert path" , "Your cert password") #If there are account groupings, multiple account information will be returned
## accounts = sdk.login("Your ID", "Your Password", "Your cert path") # If you use the "default" password for your certificate, for SDK v1.3.2 and newer versions

acc = accounts.data[0]

Send Order

Next, add the following example code to demonstrate how to use the Fubon API to place a limit order to buy 1 board lot of Fubon Financial Holding Co., Ltd. (2881) at the fall stop price.

order = Order(
buy_sell = BSAction.Buy,
symbol = "2881",
price = None,
quamtity = 2000,
market_type = MarketType.Common,
price_type = PriceType.LimitDown,
time_in_force= TimeInForce.ROD,
order_type = OrderType.Stock,
)
sdk.stock.place_order(acc, order)