File tree 2 files changed +0
-85
lines changed
2 files changed +0
-85
lines changed Original file line number Diff line number Diff line change @@ -1632,40 +1632,6 @@ def limit_buy_order(limit_buy_order_open):
1632
1632
return order
1633
1633
1634
1634
1635
- @pytest .fixture (scope = 'function' )
1636
- def market_buy_order ():
1637
- return {
1638
- 'id' : 'mocked_market_buy' ,
1639
- 'type' : 'market' ,
1640
- 'side' : 'buy' ,
1641
- 'symbol' : 'mocked' ,
1642
- 'timestamp' : arrow .utcnow ().int_timestamp * 1000 ,
1643
- 'datetime' : arrow .utcnow ().isoformat (),
1644
- 'price' : 0.00004099 ,
1645
- 'amount' : 91.99181073 ,
1646
- 'filled' : 91.99181073 ,
1647
- 'remaining' : 0.0 ,
1648
- 'status' : 'closed'
1649
- }
1650
-
1651
-
1652
- @pytest .fixture
1653
- def market_sell_order ():
1654
- return {
1655
- 'id' : 'mocked_limit_sell' ,
1656
- 'type' : 'market' ,
1657
- 'side' : 'sell' ,
1658
- 'symbol' : 'mocked' ,
1659
- 'timestamp' : arrow .utcnow ().int_timestamp * 1000 ,
1660
- 'datetime' : arrow .utcnow ().isoformat (),
1661
- 'price' : 0.00004173 ,
1662
- 'amount' : 91.99181073 ,
1663
- 'filled' : 91.99181073 ,
1664
- 'remaining' : 0.0 ,
1665
- 'status' : 'closed'
1666
- }
1667
-
1668
-
1669
1635
@pytest .fixture
1670
1636
def limit_buy_order_old ():
1671
1637
return {
@@ -2946,14 +2912,6 @@ def limit_order(limit_buy_order_usdt, limit_sell_order_usdt):
2946
2912
}
2947
2913
2948
2914
2949
- @pytest .fixture (scope = 'function' )
2950
- def market_order (market_buy_order_usdt , market_sell_order_usdt ):
2951
- return {
2952
- 'buy' : market_buy_order_usdt ,
2953
- 'sell' : market_sell_order_usdt
2954
- }
2955
-
2956
-
2957
2915
@pytest .fixture (scope = 'function' )
2958
2916
def limit_order_open (limit_buy_order_usdt_open , limit_sell_order_usdt_open ):
2959
2917
return {
Original file line number Diff line number Diff line change 30
30
tests_start_time = arrow .get (2018 , 10 , 3 )
31
31
timeframe_in_minute = 60
32
32
33
- # Helpers for this test file
34
-
35
-
36
- def _validate_ohlc (buy_ohlc_sell_matrice ):
37
- for index , ohlc in enumerate (buy_ohlc_sell_matrice ):
38
- # if not high < open < low or not high < close < low
39
- if not ohlc [3 ] >= ohlc [2 ] >= ohlc [4 ] or not ohlc [3 ] >= ohlc [5 ] >= ohlc [4 ]:
40
- raise Exception ('Line ' + str (index + 1 ) + ' of ohlc has invalid values!' )
41
- return True
42
-
43
-
44
- def _build_dataframe (buy_ohlc_sell_matrice ):
45
- _validate_ohlc (buy_ohlc_sell_matrice )
46
- data = []
47
- for ohlc in buy_ohlc_sell_matrice :
48
- d = {
49
- 'date' : tests_start_time .shift (
50
- minutes = (
51
- ohlc [0 ] *
52
- timeframe_in_minute )).int_timestamp *
53
- 1000 ,
54
- 'buy' : ohlc [1 ],
55
- 'open' : ohlc [2 ],
56
- 'high' : ohlc [3 ],
57
- 'low' : ohlc [4 ],
58
- 'close' : ohlc [5 ],
59
- 'sell' : ohlc [6 ]}
60
- data .append (d )
61
-
62
- frame = DataFrame (data )
63
- frame ['date' ] = to_datetime (frame ['date' ],
64
- unit = 'ms' ,
65
- utc = True ,
66
- infer_datetime_format = True )
67
-
68
- return frame
69
-
70
-
71
- def _time_on_candle (number ):
72
- return np .datetime64 (tests_start_time .shift (
73
- minutes = (number * timeframe_in_minute )).int_timestamp * 1000 , 'ms' )
74
-
75
-
76
33
# End helper functions
77
34
# Open trade should be removed from the end
78
35
tc0 = BTContainer (data = [
You can’t perform that action at this time.
0 commit comments