mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
test case added: edge stop loss for pair
This commit is contained in:
parent
77cac9e562
commit
d3078d7564
|
@ -41,6 +41,21 @@ def test_filter(mocker, default_conf):
|
||||||
assert(edge.filter(pairs) == ['E/F', 'C/D'])
|
assert(edge.filter(pairs) == ['E/F', 'C/D'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_stoploss(mocker, default_conf):
|
||||||
|
exchange = get_patched_exchange(mocker, default_conf)
|
||||||
|
edge = Edge(default_conf, exchange)
|
||||||
|
mocker.patch('freqtrade.edge.Edge._cached_pairs', mocker.PropertyMock(
|
||||||
|
return_value=[
|
||||||
|
['E/F', -0.01, 0.66, 3.71, 0.50, 1.71],
|
||||||
|
['C/D', -0.01, 0.66, 3.71, 0.50, 1.71],
|
||||||
|
['N/O', -0.01, 0.66, 3.71, 0.50, 1.71]
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
pairs = ['A/B', 'C/D', 'E/F', 'G/H']
|
||||||
|
assert edge.stoploss('E/F') == -0.01
|
||||||
|
|
||||||
|
|
||||||
def _validate_ohlc(buy_ohlc_sell_matrice):
|
def _validate_ohlc(buy_ohlc_sell_matrice):
|
||||||
for index, ohlc in enumerate(buy_ohlc_sell_matrice):
|
for index, ohlc in enumerate(buy_ohlc_sell_matrice):
|
||||||
# if not high < open < low or not high < close < low
|
# if not high < open < low or not high < close < low
|
||||||
|
|
Loading…
Reference in New Issue
Block a user