Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Schedule_function help

I cloned this promising algo from
First post, K filter across as many stocks as you want But commented schedule_function (line 39) do not work.
And it trades every minute.

Can somebody help configure schedule_function right way that it will reallocate positions once per day at close price?

Vladimir

2 responses

well imho something seems to be messed up here, I guess the author started refactoring it and did but did not finish...
the underlying function of the handle passed to schedule_function should only have 2 params, not 3. furthermore, they should not be specified at all when passing the handle as a parameter to schedule_function.

Yes, you should be passing a function to schedule function. In the current form you are calling the function in question and passing the result to the function. The schedule function will call your function at the right time with context and data provided as params. Try this:

schedule_function(crunch, date_rules.week_end(), time_rules.market_open(minutes = 60))