IB TWS Algo Orders

Discussion in 'Automated Trading' started by BigDog, Apr 6, 2009.

  1. BigDog

    BigDog

    Has anyone figured out the formatting of the order string for a VWAP or ArrivalPx algo order?

    Zero help so far from IB on this one.
     
  2. BigDog

    BigDog

    Here is an example, in using ActiveX with Vwap IB Algo.

    Dim m_ITagvaluelist As TWSLib.ITagValueList
    m_ITagvaluelist = Tws1.createTagValueList

    Dim m_ITagvalue1 As TWSLib.ITagValue
    m_ITagvalue1 = m_ITagvaluelist.Add("maxPctVol", ".01")

    Dim m_contract As TWSLib.IContract
    m_contract = Tws1.createContract

    With m_contract
    .symbol = "IBM"
    .secType = "STK"
    .exchange = "SMART"
    .currency = "USD"
    End With

    Dim m_order As TWSLib.IOrder
    m_order = Tws1.createOrder

    With m_order
    .action = "BUY"
    .totalQuantity = 100
    .orderType = "LMT"
    .lmtPrice = 120
    .algoStrategy = "Vwap"
    .algoParams = m_ITagvaluelist
    End With

    Tws1.placeOrderEx(validID, m_contract, m_order)