IB用家討論區 (9)

1001 回覆
11 Like 2 Dislike
2024-03-08 11:50:16
2024-03-08 11:57:55
2024-03-08 12:22:29
想問下,如果你IB户口未執行的限價盤金額超過你戶口有既cash,IB會唔會自動將超出既金額變為孖展?

問題係個d只係限價盤,可能永遠都唔會實現到,所以超出部分唔應該計我孖展!實際超出但未實現既金額IB到底計本金定計孖展?
2024-03-08 12:25:43
請問一下,去左旅行,但係login要sms認證,咁有冇方法可以login
2024-03-08 12:34:08
dl 個app 升做ibkey
但升左就冇得轉返sms
2024-03-08 12:56:10
開語音漫遊(唔駛開數據漫遊)。係外國收香港SMS係唔駛錢。
2024-03-08 15:48:14
Fps 入錢要等幾耐到
2024-03-08 16:41:05
Lm
2024-03-08 17:46:42
2024-03-08 20:21:52
想問IB個活期利息10萬美金價值
其實計唔計埋股票
因為我上IB個網個利息計算機
一定要現金先可以計入10萬入面
但係網上睇片 維尼姐果啲
又話現金股票都計
2024-03-08 20:46:39
如果想由FPS 轉左 EDDA 可唔可以都係同一個 銀行户口,而且一轉做 EDDA 就入錢即係用到?仲有如果轉左 EDDA 後入美金都即係 OK用到因為入美金只可以揀 Transfer
2024-03-08 23:58:50
想問下應語應該選擇overnight trading呢?個overnight limit order同正常trade既limit order有何分別啊
2024-03-09 01:55:03
有冇人係英國澳洲,IB 賺左既錢點報稅?
2024-03-09 06:01:35
你諗多次咩叫做「活期利息」
2024-03-09 13:26:57
想問下ibhk現金戶口有冇T+2規則?
即係尋晚賣股票嘅錢係咪要星期二先用得?
2024-03-09 17:04:48
即用

提現金要T+2
2024-03-09 19:25:32
有冇人而加登入唔到mobile
2024-03-09 19:29:02
用APPS 唔洗收CODE
2024-03-09 21:12:22
2024-03-09 22:55:49
週經
2024-03-10 03:40:12
IB有冇得自己設計一個定投組合出黎而唔係每次都要分開買
2024-03-10 04:00:22
想用美金換日圓 有冇師兄教路
開咗兩次市價單之後cut單
會唔會扣手續費
而家唔夠港紙做兌換手續費
2024-03-10 09:54:55
可以經api

每月投資組合QQQ,SPY ,AAPL

```python
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
from ibapi.order import Order


class IBWrapper(EWrapper):
    def __init__(self):
        self.next_order_id = None

    def nextValidId(self, orderId: int):
        self.next_order_id = orderId


class IBClient(EClient):
    def __init__(self, wrapper):
        EClient.__init__(self, wrapper)


def create_contract(symbol: str, sec_type: str, exchange: str, currency: str):
    contract = Contract()
    contract.symbol = symbol
    contract.secType = sec_type
    contract.exchange = exchange
    contract.currency = currency
    return contract


def create_order(action: str, quantity: float):
    order = Order()
    order.action = action
    order.orderType = "MKT"  # 使用市價單
    order.totalQuantity = quantity
    return order


if __name__ == "__main__":
    # 建立 IBWrapper 和 IBClient
    wrapper = IBWrapper()
    client = IBClient(wrapper)
    client.connect("127.0.0.1", 7497, clientId=1)  # 連接到 IB 交易平台

    # 等待連接成功
    while not client.isConnected():
        pass

    # 等待接收下一個訂單 ID
    while wrapper.next_order_id is None:
        pass

    # 建立合約
    qqq_contract = create_contract("QQQ", "STK", "SMART", "USD")
    spy_contract = create_contract("SPY", "STK", "SMART", "USD")
    aapl_contract = create_contract("AAPL", "STK", "SMART", "USD")

    # 設置訂單
    qqq_order = create_order("BUY", 10)  # 購買 10 股 QQQ
    spy_order = create_order("BUY", 5)  # 購買 5 股 SPY
    aapl_order = create_order("BUY", 20)  # 購買 20 股 AAPL

    # 下單
    client.placeOrder(wrapper.next_order_id, qqq_contract, qqq_order)
    client.placeOrder(wrapper.next_order_id + 1, spy_contract, spy_order)
    client.placeOrder(wrapper.next_order_id + 2, aapl_contract, aapl_order)

    # 斷開連接
    client.disconnect()

```
2024-03-10 13:04:01
2024-03-10 16:58:42
唔係有Basket trade UI咩
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞