Schedule Strategies in IB api

Is there any way to schedule functions in ib API as we do in blueshift using schedule function(date_rules,time_rules)?

Hi ABHISHEK,



You can use the "schedule_function" function in IBridgePy. It has similar date and time rule also.



You can check the documentation for this function from this link: Documentation -

Thank You Danish for replying.As ibridgepy is not compatible with python 3.9,I didn't use it.

I have followed documentation provided in interactive brokers for TWS APIv9.72+ till now but couldn't find a way of schedule function as I am using only time.sleep().

So,It will be helpful if i can find anything in documentation. 

Hey Abhishek,



IB API provides only a set of functions that can be used to automate trading operations. It does not offer any functionality that has to do with the logistics of how those trading operations need to be performed. That is, it is not concerned about things like how signals are generated, when what actions need to be taken and so on. Hence, it does not offer any functionalities on those lines.



I think other standalone Python libraries can help address such issues. For example, we can either use a schedule or sched libraries to schedule events. 



On the other hand, platforms like Blueshift and IBridgePy offer frameworks to research, backtest and live trade. Hence, they offer a suite of functionalities required to create a full-fledged strategy.



Also, I won't recommend using the time library to schedule any events. It is not meant for that purpose. And usually, we use time.sleep() to introduce intentional delays during the execution rather than scheduling anything. 

Thank you Jay for your response