Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Checking data on the next bar

Having some trouble figuring out how to go about this.
Basically Im looking to check the current bar/ data to see if my indicators equal a certain amount then check the next candle bar again for entry into a position.
How do I make the algo check, then wait for the next bar to check again?

1 response

Hello Josh,

If you add a market proxy sid to your algo (e.g. SPY), handle_data will be called every day/minute the market is open. This is due to the data "aggregation" that Fawce describes on https://www.quantopian.com/posts/thinly-traded-stocks-why-no-gaps.

One way to set up the check is to use a flag. For example, set context.submitted = True after you submit orders. Then, if context.submitted = True, you can check the status of the orders (and perhaps skip evaluating your indicators until the orders have been filled).

Do you have code you could post that would illustrate what you are trying to do?

Grant