Galts-Gulch / avarice

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

AttributeError: type object 'DMI' has no attribute 'Trader' #11

Closed ghost closed 9 years ago

ghost commented 9 years ago

Trying the new implementation of ADX in simulation but am getting the following error. I will fully admit that I may not of configured it correctly in genconfig.

Database is recent enough; resuming Waiting 12.43 minutes to resume on schedule Connecting to Public OKCoin WebSocket... Candle: 360 | Price: 1394.84 cny | Time: 09:17:59 | Date: 201 Exception in thread Thread-1: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstra self.run() File "C:\Python34\lib\threading.py", line 1187, in run self.function(_self.args, *_self.kwargs) File "C:\AvariceSimulation\genutils.py", line 15, in do_eve worker_func() File "C:\AvariceSimulation\avarice.py", line 34, in RunComm getattr(strategies, gc.Trader.AdvancedStrategy)() File "C:\AvariceSimulation\strategies.py", line 121, in Def genind = getattr(genconfig, i).Trader AttributeError: type object 'DMI' has no attribute 'Trader'

ghost commented 9 years ago

I may of fixed it. I haven't received that error again after using the double bracket. [['EMA' , 'DMI']]

RealJohnGalt commented 9 years ago

I'll catch that exception in strategies to print a better error if a volatility indicator is used on it's own. Volatility indicators may only be used as a combined indicator with a non volatility indicator since they don't generate signals on their own.

RealJohnGalt commented 9 years ago

I have another suggestion for you actually (which will be in the indicator documentation for all volatility indicators that I've yet to write). Set

VerboseIndicators = ['DMI']

A well configured volatility indicator threshold will change dramatically based on candle size, so you may want to see the values to get a better idea of what you want out of it. Wilder tended to use 20, but those were also on 1d candles.

Edit: There is also a real bug here; DMI needs a Trader class if run independently and using the "Full" indicator strategy which is not only a volatility indicator (generates crossover signals as well).

RealJohnGalt commented 9 years ago

Fixed in f8e113aa and 4ccf71300a