コード例 #1
0
ファイル: data.py プロジェクト: mikimaus78/botcoin
 def bollingerbands(self, k, price_type='close'):
     ave = np.mean(getattr(self, price_type))
     sd = np.std(getattr(self, price_type))
     upband = ave + (sd*k)
     lwband = ave - (sd*k)
     return _round(ave), _round(upband), _round(lwband)
コード例 #2
0
ファイル: risk.py プロジェクト: mikimaus78/botcoin
 def adjust_price_for_slippage(self, direction, price):
     direction_mod = -1 if direction in ('SELL','SHORT') else 1
     # print(self.MAX_SLIPPAGE)
     return _round(price * (1+self.MAX_SLIPPAGE*direction_mod))
コード例 #3
0
ファイル: data.py プロジェクト: mikimaus78/botcoin
 def mavg(self, price_type='close'):
     return _round(np.mean(getattr(self, price_type)))