Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Question about how often program runs and how it works.

Hello all,

I am just getting used to creating some very basic algorithms using Quantopian. I have an idea for an intra-day trading alogorithm that I have used manually with some pretty good success, however, it relies on being able to make decisions in real-time. I am a little confused as to how the Quantopian programs work and I hope someone can fill me in.

My question is: When you enter specific information that needs to be filled in order to make an order, is the program looking for these requirements all the time or does the program only look for data once a minute--essentially leaving a minute of time where the program will not make a trade even if all requirements are met?

Thank you for any and all help!

3 responses

The code executes on the whole minute, when new data are available. Orders (and order cancellations, I think) are sent asynchronously, though, as soon as they are encountered in code execution.

Great, thanks for the reply.

Is it possible to perform orders in Quantopian that cancel if the other is filled, i.e, you order to buy AAPL @ 100.00, but at the same time want to put in two additional orders that will cancel if the other is filled like an order to sell AAPL @ 102.00 or sell AAPL at 99.00. Essentially to take your gain if it reaches that point, but also protecting yourself from downside with the stop-loss order.

I'm not sure, but I think not. I suggest having a look at the help page. All of the order types are described there, along with guidance on how to check on order status. Note also that when live trading with Interactive Brokers and Robinhood, all orders are cancelled automatically at the end of the trading day. This behavior is not replicated in the backtester; you'd need to add your own code to cancel everything.