예제 #1
0
파일: _rsi.py 프로젝트: cdbfoster/trade_bot
    def __init__(self, input_, period):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)

        self.__slope = FunctionInput(Slope(input_))
        self.__average_gain = None
        self.__average_loss = None

        Function.__init__(self)
예제 #2
0
    def __init__(self, input_, period):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)

        self.__last_boundary = 0
        self.__last_period = None
        self.lows = []

        Function.__init__(self)
예제 #3
0
    def __init__(self, input_, period):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)

        self.__mean = 0.0
        self.__error_sum = 0.0
        self.__variance = 0.0

        Function.__init__(self)
예제 #4
0
    def __init__(self, symbol, public_key=None, private_key=None, reset_timeout=10, sandbox=False, record_trades=True):
        self.__symbol = symbol
        self.__public_key = public_key
        self.__private_key = private_key

        self.__prices = []

        self.__public_listener = PublicListener(self.__symbol, reset_timeout, sandbox, record_trades)

        Function.__init__(self)
예제 #5
0
    def __init__(self, input_, pooling_period, period_count, multiplier):
        self.__period_count = FunctionInput(period_count)
        self.__multiplier = FunctionInput(multiplier)

        self.__low = FunctionInput(Low(Skip(input_, 1), pooling_period))
        self.__atr = FunctionInput(Atr(input_, pooling_period, period_count))

        self.__current_period = 0
        self.__current_period_count = None

        Function.__init__(self)
예제 #6
0
    def __init__(self, input_, pooling_period, period_count):
        self.__input = FunctionInput(input_)
        self.__pooling_period = FunctionInput(pooling_period)
        self.__period_count = FunctionInput(period_count)

        self.__last_pool_boundary = None
        self.__last_pooling_period = None
        self.__trs = []
        self.atrs = []

        Function.__init__(self)
예제 #7
0
    def __init__(self, input_, period, zrange, alpha):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)
        self.__zrange = FunctionInput(zrange)
        self.__alpha = FunctionInput(alpha)

        self.__zscore = FunctionInput(ZScore(input_, period))

        self.__entropy = 1.0
        self.__ema = 0

        Function.__init__(self)
예제 #8
0
    def __init__(self, filename, start=None, position=None, reverse=False):
        self.__prices = list(
            float(line.strip()) for line in open(filename)
            if not line.startswith("#"))

        if reverse:
            self.__prices = self.__prices[::-1]
        if start:
            self.__prices = self.__prices[start:]

        self.__position = position if position is not None else max(
            len(self.__prices) - 1, 0)

        Function.__init__(self)
예제 #9
0
    def __init__(self, input_, std_dev_period, band_min, band_max, band_count,
                 interpolate):
        self.__input = FunctionInput(input_)
        self.__interpolate = interpolate

        self.__band_periods = np.geomspace(band_min, band_max, band_count)
        self.__bands = list(
            FunctionInput(
                StandardDeviation(EhlersWayBandpass(input_, period, 0.5),
                                  std_dev_period))
            for period in self.__band_periods)
        for i, band in enumerate(self.__bands):
            setattr(self, "_DominantBand__band{}".format(i), band)

        Function.__init__(self)
예제 #10
0
    def __init__(self, input_, period):
        self.__up = FunctionInput(AroonUp(input_, period))
        self.__down = FunctionInput(AroonDown(input_, period))

        Function.__init__(self)
예제 #11
0
 def __init__(self):
     Function.__init__(self)
예제 #12
0
    def __init__(self, input_, skip):
        self.__input = FunctionInput(input_)
        self.__skip = int(skip)

        Function.__init__(self)
예제 #13
0
    def __init__(self, input_, period):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)

        Function.__init__(self)
예제 #14
0
    def __init__(self, input_, period, delta):
        self.__input = FunctionInput(input_)
        self.__period = FunctionInput(period)
        self.__delta = FunctionInput(delta)

        Function.__init__(self)
예제 #15
0
    def __init__(self, input_, change, period):
        self.__input = FunctionInput(input_)
        self.__change = FunctionInput(change)
        self.__period = FunctionInput(period)

        Function.__init__(self)
예제 #16
0
    def __init__(self, input1, input2):
        self.input1 = FunctionInput(input1)
        self.input2 = FunctionInput(input2)

        Function.__init__(self)
예제 #17
0
    def __init__(self, input_):
        self.__input = FunctionInput(input_)

        Function.__init__(self)