Galts-Gulch / avarice

Multi-Indicator Python3 OKCoin CN & Intl Trading Bot/Infrastructure
Other
91 stars 29 forks source link

ZeroDivisionError: float division by zero #15

Closed ghost closed 9 years ago

ghost commented 9 years ago

Latest build looks to have a minor bug. Once it appears it will appear with every candle after.

[SIMULATOR] Asset: 1 btc Currency: 0 cny Net Worth: 1736.7426899999998 cny Candle: 606 | Price: 1724.67 cny | Time: 19:37:03 | Date: 2015/03/07 MACD : We are in a Downtrend | Diff: 0.3642543770251905 MACD Hist: -0.44509306713349683 Exception in thread Thread-287: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 1187, in run self.function(_self.args, *_self.kwargs) File "C:\AvariceSimulation\genutils.py", line 16, in do_every worker_func() File "C:\AvariceSimulation\avarice.py", line 39, in RunCommon {executor.submit(getattr(indicators, ind).indicator()): ind for ind in gc.I dicatorList} File "C:\AvariceSimulation\avarice.py", line 39, in {executor.submit(getattr(indicators, ind).indicator()): ind for ind in gc.I dicatorList} File "C:\AvariceSimulation\indicators.py", line 321, in indicator ldb.price_list, gc.FastStochK.Period)) File "C:\AvariceSimulation\indicators.py", line 71, in FastStochK

Candle: 607 | Price: 1724.67 cny | Time: 19:52:03 | Date: 2015/03/07 MACD : We are in a Downtrend | Diff: 0.31267790729816625 MACD Hist: -0.39733562948841683 Exception in thread Thread-289: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 1187, in run self.function(_self.args, *_self.kwargs) File "C:\AvariceSimulation\genutils.py", line 16, in do_every worker_func() File "C:\AvariceSimulation\avarice.py", line 39, in RunCommon {executor.submit(getattr(indicators, ind).indicator()): ind for ind in gc.I dicatorList} File "C:\AvariceSimulation\avarice.py", line 39, in {executor.submit(getattr(indicators, ind).indicator()): ind for ind in gc.I dicatorList} File "C:\AvariceSimulation\indicators.py", line 321, in indicator ldb.price_list, gc.FastStochK.Period)) File "C:\AvariceSimulation\indicators.py", line 71, in FastStochK

RealJohnGalt commented 9 years ago

Thank you! It seems I missed these in that last batch of fixes. Give me just a few minutes.