def sell(open_p, close_p, low_p, high_p, volume): sell = [0] sar = PSAR(close_p) for i in range(1, len(close_p)): if sar[i] > close_p[i]: sell.append(1) else: sell.append(0) return sell
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] sar = PSAR(close_p) ccurve = CoppockCurve(close_p) for i in range(1, len(close_p)): if ccurve[i] < 0 and sar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] gapo = GAPO(high_p, low_p) sar = PSAR(close_p) for i in range(1, len(close_p)): if gapo[i] < 1 and sar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] mfi = MFI(close_p, high_p, low_p, volume) sar = PSAR(close_p) for i in range(1, len(close_p)): if mfi[i] < 30 and sar[i] > close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] psar = PSAR(close_p) lrf = LRF(close_p) for i in range(1, len(close_p)): if psar[i] < close_p[i] and lrf[i - 1] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] sar = PSAR(close_p) roc = ROC(close_p) for i in range(1, len(close_p)): if roc[i] > 0 and sar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p,close_p,low_p,high_p,volume): buy=[0] ci=ChoppinessIndex(close_p,high_p,low_p) psar=PSAR(close_p) for i in range(1,len(close_p)): if ci[i]<38.2 and psar[i]<close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] psar = PSAR(close_p) qstick = Qstick(close_p, open_p) for i in range(1, len(close_p)): if qstick[i] < 0 and psar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def sell(open_p, close_p, low_p, high_p, volume): sell = [0] SAR = PSAR(close_p) strend = supertrend(close_p, high_p, low_p, 7, 3) for i in range(1, len(close_p)): if close_p[i] < strend[i] or close_p[i] < SAR[i]: sell.append(1) else: sell.append(0) return sell
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] SAR = PSAR(close_p) strend = supertrend(close_p, high_p, low_p, 7, 3) for i in range(1, len(close_p)): if close_p[i] > strend[i] and close_p[i] > SAR[i]: buy.append(1) else: buy.append(0) return buy
def sell(open_p, close_p, low_p, high_p, volume): sell = [0] # tech indicators psar = PSAR(close_p) for i in range(1, len(close_p)): #sell condition if psar[i] > close_p[i]: sell.append(1) else: sell.append(0) return sell
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] pvo = PVO(volume, 12, 26) cmf = CMF(close_p, low_p, high_p, volume, 20) psar = PSAR(close_p) for i in range(1, len(close_p)): if cmf[i] < 0 and pvo[i] < 0 and psar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p,close_p,low_p,high_p,volume): buy=[0] sar=PSAR(close_p) strend=supertrend(close_p,high_p,low_p) trix=TRIX(close_p,14) for i in range(1,len(close_p)): if trix[i]<0 and strend[i] < close_p[i] and sar[i]<close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p, close_p, low_p, high_p, volume): buy = [0] # tech indicators psar = PSAR(close_p) qstick = Qstick(close_p, open_p) for i in range(1, len(close_p)): # buy condition if qstick[i] < 0 and psar[i] < close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p,close_p,low_p,high_p,volume): buy=[0] so=SO(close_p,high_p,low_p) psar=PSAR(close_p) mid,up,low=BB(close_p) bb=[i-j for (i,j) in zip(up,low)] for i in range(1,len(close_p)): if bb[i]>20 and psar[i]<close_p[i]: buy.append(1) else: buy.append(0) return buy
def buy(open_p,close_p,low_p,high_p,volume): buy=[0] # tech indicators sar=PSAR(close_p) strend=supertrend(close_p,high_p,low_p) up,down,oscillator=Aroon(list(close_p),14) for i in range(1,len(close_p)): # buy condition if oscillator[i]<0 and strend[i] < close_p[i] and sar[i]<close_p[i]: buy.append(1) else: buy.append(0) return buy