📜  如何获得最低价格的 quantopian - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:34.790000             🧑  作者: Mango

代码示例1
def initialize(context):  
   schedule_function(ohlcv, date_rules.week_end())  
   context.stock = sid(24)  #AAPL  
def handle_data(context,data):  
    pass

def ohlcv(context,data):  
    weekly_high = max(history(5, '1d', 'high'))  
    weekly_low = min(history(5, '1d', 'low'))  
    close_prices = history(5, '1d', 'price')  #gives close price for the last 5 days for all stocks in the algo