Skip to main content

Preparation

caution

Before starting with the Fubon Neo API, complete the following steps:

  1. Prepare your Fubon Futures account. If you do not have one, open an account online.
  2. Sign the API risk disclosure.
  3. Apply for a certificate.

Prepare your Fubon Futures account

Use your Fubon Futures account.

Fubon Futures account

Sign the API risk disclosure

Use the 富邦e點通 mobile app or the desktop E+ application to sign the API agreement online.

Signing complete

Congratulations, you have signed the risk disclosure.

Apply for a certificate

Go to Certificate Application and Renewal, select Run now to download Fubon Securities Certificate e-Manager (TCEM.exe), and apply for a certificate.

Certificate application

After logging in and completing authentication, enter the OTP verification code sent to your mobile phone or email address.

OTP

After the application is complete, the certificate is stored in C:\CAFubon\\(Your ID number) and uses your ID number as the filename.

Certificate location

Installation and version compatibility

For installation steps and minimum version requirements, see Installation and Version Compatibility. Download the SDK from the SDK download page.

Start Your Program Trading Journey

from fubon_neo.sdk import FubonSDK, Order
from fubon_neo.constant import TimeInForce, FutOptOrderType, FutOptPriceType, FutOptMarketType, CallPut, BSAction

# Connect and login
sdk = FubonSDK()

accounts = sdk.login("Your ID", "Your Password", "Your cert path" , "Your cert password")
## 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]

# Create order object
order = FutOptOrder(
buy_sell = BSAction.Sell,
symbol = "TXFD4",
price = "20800",
lot = 3,
market_type = FutOptMarketType.Future,
price_type = FutOptPriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = FutOptOrderType.Auto,
user_def = "Python" # optional field
)

# Place an order
order_res = sdk.futopt.place_order(acc, order)
print(order_res)

Congratulations 🎊 after placing your order, you will be able to see the system's response.

Result { is_success: True, message: None, data : { function_type: 0, date : "2023/10/13", seq_no : "00000000016", branch_no : "6460", account : "26", order_no : "bA627", asset_type : 1, market : "TAIMEX", market_type : Future, symbol : "FITX", unit : 1 , currency : "TWD", expiry_date : "202404", strike_price : , call_put : , buy_sell : Buy , price_type : Limit, price : 20800, lot : 3, time_in_force : ROD, order_type : Auto, is_pre_order : False, status : 10, after_price_type : Limit, afterPrice : 20800, after_lot : 2000, filled_lot : 0, filled_money : 0, ... , user_def : "FromPyhton", last_time : "12:19:06.048", error_message : } }