Skip to content

Commit 275cc8f

Browse files
authored
Backing out additional test case kernc#316
1 parent bd2c7bb commit 275cc8f

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

backtesting/test/_test.py

+1-27
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
plot_heatmaps,
2929
random_ohlc_data,
3030
)
31-
from backtesting.test import GOOG, EURUSD, SMA, AMZN
31+
from backtesting.test import GOOG, EURUSD, SMA
3232
from backtesting._util import _Indicator, _as_str, _Array, try_
33-
from talib import RSI,EMA,ATR,MINMAX
3433

3534
SHORT_DATA = GOOG.iloc[:20] # Short data for fast tests with no indicator lag
3635

@@ -862,31 +861,6 @@ def next(self):
862861
stats = Backtest(GOOG, S).run()
863862
self.assertEqual(stats['# Trades'], 57)
864863

865-
def test_TrailingStrategy_should_not_raise_Assert_error(self):
866-
class Breakout(TrailingStrategy):
867-
timeperiod = 10
868-
position_size_decimal = 0.2
869-
min_close = []
870-
max_close = []
871-
def init(self):
872-
super().init()
873-
self.ema20 = self.I(EMA,self.data.Close,20,overlay=True)
874-
self.atr14 = self.I(ATR,self.data.High,self.data.Low,self.data.Close,14)
875-
self.set_atr_periods(20)
876-
self.set_trailing_sl(1.5)
877-
print(type(self.data.Close))
878-
self.min_close, self.max_close = MINMAX(self.data.Close, timeperiod=self.timeperiod)
879-
880-
def next(self):
881-
super().next()
882-
index = len(self.data)-1
883-
if not self.position.is_long and self.min_close[index] > (self.max_close[index] * 0.98) and self.max_close[index] < (self.min_close[index] * 1.02):
884-
self.buy(size=self.position_size_decimal)
885-
886-
stats = Backtest(AMZN,Breakout).run()
887-
self.assertEqual(stats['# Trades'], 23)
888-
889-
890864
class TestUtil(TestCase):
891865
def test_as_str(self):
892866
def func():

0 commit comments

Comments
 (0)