def __init__(self, ts, entries, stops, is_relative=True, only_first=True): """A Trailing Stop order is a stop order that can be set at a defined percentage or amount away from the current market price. The main difference between a regular stop loss and a trailing stop is that the trailing stop moves as the price moves.""" self.exits = Signals( tstop_exits_nb(ts, entries, stops, is_relative, only_first))
def __init__(self, ts, entries, stops, is_relative=True, only_first=True): """A stop-loss is designed to limit an investor's loss on a security position. Setting a stop-loss order for 10% below the price at which you bought the stock will limit your loss to 10%.""" self.exits = Signals( stoploss_exits_nb(ts, entries, stops, is_relative, only_first))
def is_fast_below_slow(self): return Signals(self.fast < self.slow)
def is_fast_above_slow(self): return Signals(self.fast > self.slow)
def is_rsi_below_threshold(self, threshold): return Signals(self.rsi < threshold)
def is_rsi_above_threshold(self, threshold): return Signals(self.rsi > threshold)
def is_bandwidth_below_threshold(self, threshold): return Signals(self.bandwidth < threshold)
def is_bandwidth_above_threshold(self, threshold): return Signals(self.bandwidth > threshold)
def is_percent_b_below_threshold(self, threshold): return Signals(self.percent_b < threshold)
def is_percent_b_above_threshold(self, threshold): return Signals(self.percent_b > threshold)
def is_rsi_below(self, thresholds): return Signals(below_thresholds_nb(self.rsi, thresholds))
def is_rsi_above(self, thresholds): return Signals(above_thresholds_nb(self.rsi, thresholds))
def is_bandwidth_below(self, thresholds): return Signals(below_thresholds_nb(self.bandwidth, thresholds))
def is_bandwidth_above(self, thresholds): return Signals(above_thresholds_nb(self.bandwidth, thresholds))
def is_percent_b_below(self, thresholds): return Signals(below_thresholds_nb(self.percent_b, thresholds))
def is_percent_b_above(self, thresholds): return Signals(above_thresholds_nb(self.percent_b, thresholds))