Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Scheduling Times of the Day to Run This Trade

I'm new to Quantopian and I've being playing around with some of the sample.

My question is similar to the one I posted in this thread (https://www.quantopian.com/posts/timed-restriction-on-re-buying-stock), I've been trying to get the schedule function working with this algorithm (as it might be a solution to my previous problem of having too many trades in a day), but I keep getting an error whenever I try to add a schedule.

I'm basically looking to have the algo run four times a day; at open, at close, 90 minutes after open and 90 minutes before close.

I'd really appreciate if someone could show me how to add that to this algo.

Thanks.

5 responses

Chris,

See the attached and let me know if you have questions. That should do what you're looking for if I understood your post correctly.

Thanks Greg. This works great.

Hi guys, I am also new and working on schedule_function. Does anyone know how to use a loop to call a function every minutes? I tried the sample on the Help page, it didn't work on my algo for some reason. Thanks.

You can do something like this, it schedules the function to be called every 10 minutes.

Thanks, David. That is very helpful!