当前位置: 首页>>代码示例>>Python>>正文


Python BasicData.getLowPriceInPeriod方法代码示例

本文整理汇总了Python中BasicData.getLowPriceInPeriod方法的典型用法代码示例。如果您正苦于以下问题:Python BasicData.getLowPriceInPeriod方法的具体用法?Python BasicData.getLowPriceInPeriod怎么用?Python BasicData.getLowPriceInPeriod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BasicData的用法示例。


在下文中一共展示了BasicData.getLowPriceInPeriod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: analyze

# 需要导入模块: import BasicData [as 别名]
# 或者: from BasicData import getLowPriceInPeriod [as 别名]
def analyze(stock_code, date, period1, period2):
    signal = ""
    score = 0.0
    recent_high_price = bd.getHighPriceInPeriod("CLOSE_TODAY", stock_code, date, period1)
    recent_low_price = bd.getLowPriceInPeriod("CLOSE_TODAY", stock_code, date, period1)
    close_today = bd.getBasicData("CLOSE_TODAY", stock_code, date)
    BBI = getBBI(stock_code, date)

    if (abs(close_today - recent_high_price) / recent_high_price <= HIGH_OFFSET / 100) and (BBI > close_today):
        score = score - 1
        signal = signal + "[-1]股价在高价区以收市价跌破多空线为卖出信号;"

    if (abs(close_today - recent_low_price) / recent_low_price <= LOW_OFFSET / 100) and (BBI < close_today):
        score = score + 1
        signal = signal + "[1]股价在低价区以收市价突破多空线为买入信号;"

    BBIs = getBBIs(stock_code, date, period2)
    K = mu.getPoly(BBIs, 1)[0]

    if (K > 0) and (BBI > close_today):
        score += 1
        signal += "[1]多空指数由下向上递增,股价在多空线上方,表明多头势强,可以继续持股;"

    if (K < 0) and (BBI < close_today):
        score -= 1
        signal += "[-1]多空指数由上向下递减,股价在多空线下方,表明空头势强,一般不宜买入;"

    print score
    print signal.decode("utf-8").encode("gbk")
    bd.updateAnalysisData("BBI", str(score) + ";" + signal, stock_code, date)
    return [score, signal]
开发者ID:A1eXFei,项目名称:StockMarket,代码行数:33,代码来源:BBI.py

示例2: calcWR

# 需要导入模块: import BasicData [as 别名]
# 或者: from BasicData import getLowPriceInPeriod [as 别名]
def calcWR(stock_code, date, period):
    close_today = bd.getBasicData("CLOSE_TODAY", stock_code, date)
    high_today = bd.getHighPriceInPeriod("HIGH_TODAY", stock_code, date, period)
    low_today = bd.getLowPriceInPeriod("LOW_TODAY", stock_code, date, period)
    WR = 100 - (close_today - low_today) / (high_today - low_today) * 100
    return round(WR, 3)
开发者ID:A1eXFei,项目名称:StockMarket,代码行数:8,代码来源:WR.py


注:本文中的BasicData.getLowPriceInPeriod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。