-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何拉取期权的信息? #12
Comments
谢谢,那用那个API可以获取期权的Gamma Delta这些数值? |
@sunli829 void OnSecurityCalcIndexCreated(const struct lb_async_result_t* res)
{
if (res->error)
{
printf("failed to create quote context: %s\n", lb_error_message(res->error));
return;
}
*((const lb_quote_context_t**)res->userdata) = (const lb_quote_context_t*)res->ctx;
std::vector<const char*> symbols;
symbols.push_back("NVDA240419C900000.US");
lb_quote_context_calc_indexes((const struct lb_quote_context_t*)res->ctx, symbols.data(), symbols.size(), indexes, indexes_size, [](auto result)
{
if (!result)
{
//auto msg = lb_error_message(result->error);
printf("failed to get quote!\n");
return;
}
lb_security_calc_index_t* data = (lb_security_calc_index_t*)result->data;
printf("Symbol: %s\n", data->symbol);
printf("LastDone: %f\n", lb_decimal_to_double(data->last_done));
printf("StrikePrice: %f\n", lb_decimal_to_double(data->strike_price));
printf("Implied Volatility: %f\n", *data->implied_volatility);
printf("Delta: %f\n", *data->delta);
printf("Gamma: %f\n", *data->gamma);
printf("Theta: %f\n", *data->theta);
printf("Vega: %f\n", *data->vega);
}, NULL);
} |
目前过期的期权行情只会保留 7 天,服务端返回的数据没有这个标的,您可以检查一下本地代码,打印的数据是哪里来的。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
拉取不到期权的信息。
The text was updated successfully, but these errors were encountered: