本文整理汇总了PHP中get_yahoo_rt_quote函数的典型用法代码示例。如果您正苦于以下问题:PHP get_yahoo_rt_quote函数的具体用法?PHP get_yahoo_rt_quote怎么用?PHP get_yahoo_rt_quote使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_yahoo_rt_quote函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: count
$query = "select count(*) as total_pos_tran from turtle_transaction_pandl where profit_loss > 0";
$result = queryMysql($query);
while ($data = mysql_fetch_row($result)) {
$keyStatsArray[0]['total_pos_tran'] = $data[0];
}
$query = "select count(*) as total_neg_tran from turtle_transaction_pandl where profit_loss < 0";
$result = queryMysql($query);
while ($data = mysql_fetch_row($result)) {
$keyStatsArray[0]['total_neg_tran'] = $data[0];
}
$keyStatsArray[0]['pos_tran_probability'] = round($keyStatsArray[0]['total_pos_tran'] / $keyStatsArray[0]['tran_count'] * 100, 2);
$keyStatsArray[0]['neg_tran_probability'] = round($keyStatsArray[0]['total_neg_tran'] / $keyStatsArray[0]['tran_count'] * 100, 2);
echo json_encode($keyStatsArray);
} elseif ($_GET['action'] == 'getRealTimeQuote') {
$symbol = $_GET['symbol'];
$quote = get_yahoo_rt_quote($symbol);
echo json_encode($quote);
} elseif ($_GET['action'] == 'test_turtle_portfolio_sell') {
$today_date = $_GET['today_date'];
$date = $_GET['date'];
$portfolioID = 1;
turtle_portfolio_sell($date, $portfolioID);
} elseif ($_GET['action'] == 'test_crsi_sell') {
$today_date = $_GET['today_date'];
$date = $_GET['date'];
$portfolioID = 1;
crsi_sell($date, $portfolioID);
} elseif ($_GET['action'] == 'test_turtle_portfolio_update_stop_loss') {
$today_date = $_GET['today_date'];
$date = $_GET['date'];
turtle_portfolio_update_stop_loss($date);
开发者ID:jimmyc815,项目名称:algo,代码行数:31,代码来源:connorsRSI_strat_5.php
示例2: elseif
} elseif ($_GET['action'] == 'getStockQuote') {
/* $query = $_GET['txtInputQuery'];
$query= stripslashes($query);
$result = queryMysql($query);
$sightings = array();
$sightings = mysql_resultTo2DAssocArray_JGrid($result);
echo json_encode($sightings);
*/
$stock_list = get_stock_list_from_portfolio();
//echo "stock list", $stock_list;
// $ret = get_yahoo_rt_quote ("MA+MCP+GMCR+F+WYNN+BAC+C+GS+SZYM+PER+RIMM+SFLY+PCLN");
$ret = get_yahoo_rt_quote($stock_list);
echo json_encode($ret);
exit;
} elseif ($_GET['action'] == 'getStockQuote2') {
$stock_list = get_stock_list_from_portfolio();
$ret = get_yahoo_rt_quote_2($stock_list);
echo json_encode($ret);
exit;
} elseif ($_GET['action'] == 'getHP') {
$symbol = $_GET['inputSymbol'];
$begin_date = $_GET['begin_date'];
$end_date = $_GET['end_date'];
$freq = $_GET['freq'];
$bd = explode('/', $begin_date);
$ed = explode('/', $end_date);
$begin_mon = $bd[0] - 1;
开发者ID:jimmyc815,项目名称:algo,代码行数:31,代码来源:service.php
注:本文中的get_yahoo_rt_quote函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论