trend channels to find fibionacci reference points
--HG-- branch : sandbox
This commit is contained in:
@@ -169,28 +169,6 @@ class Lohi:
|
||||
return None
|
||||
|
||||
|
||||
class Acp:
|
||||
"""Always correct predictor"""
|
||||
def __init__(self, lows, highs):
|
||||
self.lows = lows
|
||||
self.highs = highs
|
||||
|
||||
def __call__(self, tick):
|
||||
"""Always correct predictor.
|
||||
|
||||
Requires previous run of DelayedAcp to determine lows and highs.
|
||||
|
||||
@param tick: The value of the current tick.
|
||||
@type tick: tuple(n, cdt, last)
|
||||
|
||||
@return: 1. Tick if new max min has been detected,
|
||||
2. None otherwise.
|
||||
"""
|
||||
n, cdt, last = tick
|
||||
res = None
|
||||
return res
|
||||
|
||||
|
||||
def find_lows_highs(xs, ys):
|
||||
dacp = DelayedAcp(10)
|
||||
for tick in zip(range(len(xs)), xs, ys):
|
||||
@@ -222,13 +200,13 @@ class DelayedAcp:
|
||||
res = None
|
||||
# automatic initialisation
|
||||
if self.mm0 is None:
|
||||
# initalise water mark
|
||||
# initialise water mark
|
||||
self.mm0 = tick
|
||||
res = self.mm0
|
||||
self.lows = [(n, cdt, last - 1)]
|
||||
self.highs = [(n, cdt, last + 1)]
|
||||
else:
|
||||
# initalise trend until price has changed
|
||||
# initialise trend until price has changed
|
||||
if self.trend is None or self.trend == 0:
|
||||
self.trend = cmp(last, self.mm0[2])
|
||||
# check for max
|
||||
|
||||
Reference in New Issue
Block a user