コード例 #1
0
def get_option_theo_values_with_normalized_greeks(expiry_id):
    underlying_price = request.args.get("underlying_price", None)
    if underlying_price:
        underlying_price = float(underlying_price)
    db_expiry = load_db_expiry(db_session, expiry_id)
    option_theo_values_df = calc_option_theo_values_with_normalized_greeks(db_expiry, underlying_price)
    option_theo_values_df["id"] = option_theo_values_df.index
    json_df = option_theo_values_df.to_json(orient="records")
    return Response(json_df)
コード例 #2
0
def get_strike_vols(expiry_id):
    underlying_price = request.args.get("underlying_price", None)
    if underlying_price:
        underlying_price = float(underlying_price)
    db_expiry = load_db_expiry(db_session, expiry_id)
    strike_vols_df = calc_strike_vols(db_expiry, underlying_price)
    strike_vols_df["id"] = strike_vols_df.index
    json_df = strike_vols_df.to_json()
    return Response(json_df)