@@ -1061,13 +1061,17 @@ def _notify(notification: str = "", level: str = "normal") -> None:
1061
1061
# if not live
1062
1062
else :
1063
1063
if self .state .last_buy_size == 0 and self .state .last_buy_filled == 0 :
1064
- # Sim mode can now use buymaxsize as the amount used for a buy
1065
- if self .buymaxsize is not None :
1064
+ # sim mode can now use buymaxsize as the amount used for a buy
1065
+ if self .buymaxsize > 0 :
1066
1066
self .state .last_buy_size = self .buymaxsize
1067
1067
self .state .first_buy_size = self .buymaxsize
1068
+ else :
1069
+ # TODO: calculate correct buy amount based on quote currency balance
1070
+ self .state .last_buy_size = 1
1071
+ self .state .first_buy_size = 1
1068
1072
# add option for buy last sell size
1069
1073
elif (
1070
- self .buymaxsize is not None
1074
+ self .buymaxsize > 0
1071
1075
and self .buylastsellsize
1072
1076
and self .state .last_sell_size > self .state .minimum_order_quote (quote = self .state .last_sell_size , balancechk = True )
1073
1077
):
@@ -1089,7 +1093,7 @@ def _notify(notification: str = "", level: str = "normal") -> None:
1089
1093
+ "\n - TEST BUY at "
1090
1094
+ str (self .price )
1091
1095
+ "\n - Buy Size: "
1092
- + str (_truncate (self .state .last_buy_size , 4 ))
1096
+ + str (_truncate (self .state .last_buy_size , 4 )) # TODO: why is this 0?
1093
1097
)
1094
1098
1095
1099
if not self .is_verbose :
@@ -1320,6 +1324,8 @@ def _notify(notification: str = "", level: str = "normal") -> None:
1320
1324
1321
1325
# if not live
1322
1326
else :
1327
+ # TODO
1328
+
1323
1329
margin , profit , sell_fee = calculate_margin (
1324
1330
buy_size = self .state .last_buy_size ,
1325
1331
buy_filled = self .state .last_buy_filled ,
@@ -2991,6 +2997,10 @@ def get_additional_df(self, short_granularity, websocket) -> pd.DataFrame:
2991
2997
def get_last_buy (self ) -> dict :
2992
2998
"""Retrieves the last exchange buy order and returns a dictionary"""
2993
2999
3000
+ if not self .is_live :
3001
+ # not live, return None
3002
+ return None
3003
+
2994
3004
try :
2995
3005
if self .exchange == Exchange .COINBASEPRO :
2996
3006
api = CBAuthAPI (
@@ -3074,11 +3084,11 @@ def get_last_buy(self) -> dict:
3074
3084
return None
3075
3085
3076
3086
def get_taker_fee (self ):
3077
- if self .is_sim and self .exchange == Exchange .COINBASEPRO :
3087
+ if not self .is_live and self .exchange == Exchange .COINBASEPRO :
3078
3088
return 0.005 # default lowest fee tier
3079
- elif self .is_sim and self .exchange == Exchange .BINANCE :
3089
+ elif not self .is_live and self .exchange == Exchange .BINANCE :
3080
3090
return 0.0 # default lowest fee tier
3081
- elif self .is_sim and self .exchange == Exchange .KUCOIN :
3091
+ elif not self .is_live and self .exchange == Exchange .KUCOIN :
3082
3092
return 0.0015 # default lowest fee tier
3083
3093
elif self .takerfee > - 1.0 :
3084
3094
return self .takerfee
@@ -3114,7 +3124,16 @@ def get_taker_fee(self):
3114
3124
return 0.005
3115
3125
3116
3126
def get_maker_fee (self ):
3117
- if self .exchange == Exchange .COINBASEPRO :
3127
+ if not self .is_live and self .exchange == Exchange .COINBASEPRO :
3128
+ print ("WENT IN HERE - GOOD - REMOVE THIS" )
3129
+ return 0.005 # default lowest fee tier
3130
+ elif not self .is_live and self .exchange == Exchange .BINANCE :
3131
+ return 0.0 # default lowest fee tier
3132
+ elif not self .is_live and self .exchange == Exchange .KUCOIN :
3133
+ return 0.0015 # default lowest fee tier
3134
+ elif self .makerfee > - 1.0 :
3135
+ return self .makerfee
3136
+ elif self .exchange == Exchange .COINBASEPRO :
3118
3137
api = CBAuthAPI (
3119
3138
self .api_key ,
3120
3139
self .api_secret ,
0 commit comments