當前位置: 首頁>>代碼示例>>Python>>正文


Python talib.MIN屬性代碼示例

本文整理匯總了Python中talib.MIN屬性的典型用法代碼示例。如果您正苦於以下問題:Python talib.MIN屬性的具體用法?Python talib.MIN怎麽用?Python talib.MIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在talib的用法示例。


在下文中一共展示了talib.MIN屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: donchian

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def donchian(candles: np.ndarray, period=20, sequential=False) -> DonchianChannel:
    """
    Donchian Channels

    :param candles: np.ndarray
    :param period: int - default: 20
    :param sequential: bool - default=False

    :return: DonchianChannel(upperband, middleband, lowerband)
    """
    if not sequential and len(candles) > 240:
        candles = candles[-240:]

    UC = talib.MAX(candles[:, 3], timeperiod=period)
    LC = talib.MIN(candles[:, 4], timeperiod=period)
    MC = ((UC + LC) / 2)

    if sequential:
        return DonchianChannel(UC, MC, LC)
    else:
        return DonchianChannel(UC[-1], MC[-1], LC[-1]) 
開發者ID:jesse-ai,項目名稱:jesse,代碼行數:23,代碼來源:donchian.py

示例2: QSDD

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def QSDD(dataframe, SHORT=12, LONG=26, M=9):
    """
    1.line_mid向上突破line_long,買入信號參考。
    2.line_mid向下跌破line_long,賣出信號參考。
    """
    OPEN = dataframe.open
    HIGH = dataframe.high
    LOW = dataframe.low
    CLOSE = dataframe.close

    # QSDD策略
    # A = talib.MA(-100 * (talib.MAX(HIGH, 34) - CLOSE) / (talib.MAX(HIGH, 34) - talib.MIN(LOW, 34)), 19)
    # B = -100 * (talib.MAX(HIGH, 14) - CLOSE) / (talib.MAX(HIGH, 14) - talib.MIN(LOW, 14))
    # D = talib.EMA(-100 * (talib.MAX(HIGH, 34) - CLOSE) / (talib.MAX(HIGH, 34) - talib.MIN(LOW, 34)), 4)
    A = QA.MA(-100 * (QA.HHV(HIGH, 34) - CLOSE) /
              (QA.HHV(HIGH, 34) - QA.LLV(LOW, 34)), 19)
    B = -100 * (QA.HHV(HIGH, 14) - CLOSE) / \
        (QA.HHV(HIGH, 14) - QA.LLV(LOW, 14))
    D = QA.EMA(-100 * (QA.HHV(HIGH, 34) - CLOSE) /
               (QA.HHV(HIGH, 34) - QA.LLV(LOW, 34)), 4)

    line_long = A + 100
    line_short = B + 100
    line_mid = D + 100  # 信號線

    CROSS_JC = QA.CROSS(line_mid, line_long)
    CROSS_SC = QA.CROSS(line_long, line_mid)
    return pd.DataFrame({'line_mid': line_mid, 'line_long': line_long, 'CROSS_JC': CROSS_JC, 'CROSS_SC': CROSS_SC})


# create account 
開發者ID:QUANTAXIS,項目名稱:QUANTAXIS,代碼行數:33,代碼來源:strategy_qsdd.py

示例3: calculate_cmi_indicator

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def calculate_cmi_indicator(df):  # RSI

    cmi_period = 30
    cmi_ma_period = 10
    roc = df['close'].diff(cmi_period)
    h1 = ta.MAX(df['high'], cmi_period) - ta.MIN(df['low'], cmi_period)
    cmi = abs(roc / h1) * 100
    cmi_ma = ta.MA(cmi, cmi_ma_period)  # rolling.
    return cmi_ma 
開發者ID:ramoslin02,項目名稱:51bitqunt,代碼行數:11,代碼來源:technical_indicators.py

示例4: donchian

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def donchian(self, n, array=False):
        """
        Donchian Channel.
        """
        up = talib.MAX(self.high, n)
        down = talib.MIN(self.low, n)

        if array:
            return up, down
        return up[-1], down[-1] 
開發者ID:ramoslin02,項目名稱:51bitqunt,代碼行數:12,代碼來源:array_manager.py

示例5: MINMAX

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def MINMAX(series, n=30):
    return _series_to_frame(series, ['MIN', 'MAX'], talib.MINMAX, n) 
開發者ID:bpsmith,項目名稱:tia,代碼行數:4,代碼來源:talib_wrapper.py

示例6: MIN

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def MIN(series, n=30):
    return _series_to_series(series, talib.MIN, n) 
開發者ID:bpsmith,項目名稱:tia,代碼行數:4,代碼來源:talib_wrapper.py

示例7: MIN

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def MIN(data, **kwargs):
    _check_talib_presence()
    prices = _extract_series(data)
    return talib.MIN(prices, **kwargs) 
開發者ID:ranaroussi,項目名稱:qtpylib,代碼行數:6,代碼來源:talib_indicators.py

示例8: getLowest

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def getLowest(self, price, length):
        if (not isinstance(price, np.ndarray) and not isinstance(price, list)) or len(price) == 0:
            return np.array([])

        arr = np.array(price) if isinstance(price, list) else price
        if length <= 1:
            return arr

        return talib.MIN(arr, length) 
開發者ID:epolestar,項目名稱:equant,代碼行數:11,代碼來源:strategy_model.py

示例9: handle_data

# 需要導入模塊: import talib [as 別名]
# 或者: from talib import MIN [as 別名]
def handle_data(context):
    MA1 = talib.MA(Close(), timeperiod=p)
    MA2 = talib.MIN(Low(), timeperiod=p)
    MA3 = talib.MAX(High(), timeperiod=p)
    #LogInfo(MA2)
    #LogInfo(MA3)
    MA4 = talib.MA(Close(), timeperiod=N1)
    MA5 = talib.MA(Close(), timeperiod=N2)
    if len(MA2) < 55 or len(MA3) < 67:
        return

    if MarketPosition() == 0:
        if (Close()[-1] > MA1[-1]) and (MA5[-1] > MA4[-1]) and (Close()[-1] > MA3[-N0]):
            Buy(1, Close()[-1])
        elif (MA1[-1] > Close()[-1]) and (MA5[-1] < MA4[-1]) and (Close()[-1] < MA4[-1]):
            SellShort(1, Close()[-1])
        else:
            pass

    else:
        if Close()[-1] < MA2[-N]:
            Sell(1, Close()[-1])
        elif Close()[-1] > MA3[-N0]:
            BuyToCover(1,Close()[-1])    #買平倉
        else:
            pass 
開發者ID:epolestar,項目名稱:equant,代碼行數:28,代碼來源:GoStraight.py


注:本文中的talib.MIN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。