softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

IB Algo Adaptive #23

Closed manishranjan99 closed 6 years ago

manishranjan99 commented 6 years ago

Dear Abel,

Do you have an example on how to implement the IB TWS algo with the TWS? I guess specifying the algo strategy is straight forward, however, I am confused on how to create the list to add the algo parameteres. I would appreciate any help with this. https://interactivebrokers.github.io/tws-api/ibalgos.html

Kind Regards, Manish

softwarespartan commented 6 years ago

Hi Manish

Great to hear from you.

You should be able to just fill out the associated fields of the order "m_algoStrategy" and "m_algoParams" where the algoParams is actually a java.util.Vector of TagValue objects.

For example:

    order = com.ib.client.Order()
    order.m_algoStrategy = 'Adaptive'
    params = java.util.Vector()
    tagValue = com.ib.client.TagValue('adaptivePriority', 'Normal')
    params.add(tagValue)
    order.m_algoParams = params

Let me know if you need anything additional.

Cheers -abel

manishranjan99 commented 6 years ago

Hi Abel,

This looks great! Thank you so much!

Manish