Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Only getting minute data in the console, new to quantopian

I cant figure out why Im only getting minute data in the console rather than daily data, no matter what i state in the code, whether I write frequency = '1d' or frequency = '1m' , the result is always in minutes

def initialize(context):  
    # AAPL, MSFT, and SPY  
    context.securities = [sid(24), sid(5061), sid(8554)]

def handle_data(context, data):  
    prices = data.history(context.securities, "price", bar_count = 10, frequency = "1d")  
    print prices



1 response

You're getting daily data but you're requesting it every minute of the day, handle_data runs every minute by default. If you just want it once before the market opens you could use:

def before_trading_start(context, data):  

or use the schedule function to run it at a specified time of day