Galts-Gulch / avarice

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

5.0.1a Bug #32

Open ghost opened 8 years ago

ghost commented 8 years ago

I seen to get this cropping up a lot on one of my bots:

Candle: 14560 | Price: 1460.0 cny | Time: 12:41:56 | Date: 2015/08/29 MACD : We are in an Uptrend | Diff: -1.577797553469054 MACD Hist: 0.8951077486893806 FullStochRSID: 19.740019345764736 Exception in thread Thread-156: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 920, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 1186, in run self.function(_self.args, *_self.kwargs) File "C:\Avarice\genutils.py", line 16, in do_every worker_func() File "C:\Avarice\avarice.py", line 107, in RunCommon getattr(strategies, config.gc['Trader']['Advanced Strategy'])() File "C:\Avarice\strategies.py", line 76, in Default if IndList[-1] < LocalBid: TypeError: unorderable types: float() < str()

Since you are doing a major re-write not sure how important it is to fix this, but just thought I would post it.

RealJohnGalt commented 8 years ago

Damn! That's a silly mistake, I'll fix that in a few minutes.

Thank you :+1:

RealJohnGalt commented 8 years ago

Just to make sure I've got it, could you paste your config.ini with any personal info redacted?

ghost commented 8 years ago

Here is the Config file with personal info removed:

#

Everything below is fully documented in

http://galts-gulch.github.io/avarice/configuring

#

[API] Verbose = True Exchange = okcoin Trade Pair = btc_cny API Key = Key-Removed Secret Key = Key-Removed Asset Trade Minimum = 0.01 Reconnect Wait = 25

[Candles] Verbose = True Size = 15

[Trader] Enabled = False Verbose = True

All of the following is also used by Simulator

Trade Indicators = [['MACD', 'FullStochRSID']] Advanced Strategy = Default Trade Volume = 99 Single Trade = True Trade Persist = False Trade Delay = 3 ReIssue Slippage = 0.12 ReIssue Delay = 5

[Simulator] Verbose = True Asset = Assets-Removed Currency = 0

[Notifier] [[Text File]] Rollover Time = 24 Backup Count = 7 Path = ./recorded Trader File Name = trader.log Simulator File Name = simulator.log [[Pushover]] Simulator = False Trader = False App Token = stub User Key = stub [[SMTP]] Simulator = False Trader = False Host = localhost From = '"Avarice" avarice@your-domain' To = you@your-domain [[TLS SMTP]]

GMail

Simulator = False
Trader = False
Host = smtp.gmail.com
Port = 587
Username = you@gmail.com
Password = stub
To = Your full e-mail address

[[XMPP]] Simulator = False Trader = False Username = stub Password = stub Recipient = stub Host = stub Server = stub Port = stub Name = Avarice

[Database] Archive = False Store All = True Debug = True Path = ./database

[Grapher] Enabled = True Path = ./charts Theme = DarkSolarized Show Time = False Max Lookback = 30

[Indicators]

All indicators below are fully documented in

http://galts-gulch.github.io/avarice/indicators

[[Simple Movement Average]] Verbose = False

We support both CD and Diff Indicator Strategies

Indicator Strategy = CD
Candle Size Multiplier = 1
Short Period = 15
Long Period = 50
Diff Down = -0.025
Diff Up = 0.025
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Exponential Movement Average]] Verbose = False

We support both CD and Diff Indicator Strategies

Indicator Strategy = CD
Candle Size Multiplier = 1
Short Period = 10
Long Period = 21
Diff Down = -0.025
Diff Up = 0.025
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Double Exponential Movement Average]] Verbose = False

Uses both EMA's Long Period and ShortPeriod from above

# We support both CD and Diff Indicator Strategies
Indicator Strategy = CD
Candle Size Multiplier = 1
Diff Down = -0.025
Diff Up = 0.025
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[EMAwbic]] Verbose = False Candle Size Multiplier = 1 Period = 60

Buy when price is <Bid % of EMA

Bid = -75
# Sell when price is >Ask % of EMA
Ask = 95
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Fractal Adaptive Movement Average]] Verbose = False Indicator Strategy = CD Candle Size Multiplier = 1 Short Period = 10 Long Period = 21 Alpha Constant = -4.6 Diff Down = -0.025 Diff Up = 0.025 [[[Trader]]] Trade Volume = 99 Single Trade = True Trade Persist = False Trade Delay = 3

[[MACD]] Verbose = True

Mike Bruns' agressive 3/11/16 are also recommended

# We support both CD and Diff Indicator Strategies
Indicator Strategy = CD
Candle Size Multiplier = 1
Short Period = 3
Long Period = 11
Signal Period = 16
Diff Down = -0.1
Diff Up = 0.1
[[[Trader]]]
  Trade Volume = 99
  Single Trade = False
  Trade Persist = True
  Trade Delay = 3

[[DMACD]] Verbose = False

Uses MACD's Long, Short, and Signal values

# We support both CD and Diff Indicator Strategies
Indicator Strategy = CD
Candle Size Multiplier = 1
Signal Period = 9
Diff Down = -0.1
Diff Up = 0.1
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[RSI]] Verbose = False

Period can never be less than 3, but 14

# or higher is generally recommended.
Candle Size Multiplier = 1
Period = 14
Ask = 70
Bid = 30
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = False
  Trade Delay = 3

[[Fast Stochastic RSI %K]] Verbose = False

%D uses %K periods, %D periods are SMA periods of %K

Period = 3
Ask = 80
Bid = 20
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = False
  Trade Delay = 3

[[Fast Stochastic RSI %D]] Verbose = False

%D uses %K periods, %D periods are SMA periods of %K

Period = 3
Ask = 80
Bid = 20
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = False
  Trade Delay = 3

[[Full Stochastic RSI %D]] Verbose = True

Full %D uses Fast %D periods, Full %D periods are SMA periods of Fast %D

# We support both CD and Diff (standard) Indicator Strategies
Indicator Strategy = Diff
Period = 3
Ask = 80
Bid = 20
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = True
  Trade Delay = 3

[[Fast Stochastic %K]] Verbose = False Candle Size Multiplier = 1 Period = 14 Ask = 95 Bid = 5 [[[Trader]]] Trade Volume = 20 Single Trade = False Trade Persist = False Trade Delay = 3

[[Fast Stochastic %D]] Verbose = False

%D uses %K periods, %D periods are SMA periods of %K

Period = 3
Ask = 80
Bid = 20
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = False
  Trade Delay = 3

[[Full Stochastic %D]] Verbose = False

Full %D uses Fast %D periods, Full %D periods are SMA periods of Fast %D

Period = 3
Ask = 80
Bid = 20
[[[Trader]]]
  Trade Volume = 20
  Single Trade = False
  Trade Persist = False
  Trade Delay = 3

[[KDJ]] Verbose = False

We support both CD and Diff (off J) Indicator Strategies

Indicator Strategy = CD
Candle Size Multiplier = 1
Fast K Period = 9
Full K Period = 3
Full D Period = 3
Ask = 100
Bid = 0
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Aroon]] Verbose = False

We support both CD (when Aroon is > or < 0) and Diff (off bid/ask)

# This is because zero line is where AroonUp and AroonDown converge/diverge
Indicator Strategy = CD
Candle Size Multiplier = 1
Period = 25
Bid = -90
Ask = 90
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Ichimoku]] Verbose = False

Check galts-gulch.io/avarice/indicators for info on supported strategies.

Indicator Strategy = Optimized
Candle Size Multiplier = 1
Tenkan-Sen Period = 9
# Only used on Span B since SpanA just uses Tenkan-sen and Kijnun-sen.
# Default is 2 \* Kijun-Sen Period
Senkou Span Period = 52
Kijun-Sen Period = 26
# Default is the same as Kijun-Sen Period
Chikou Span Period = 26
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Standard Deviation]] Verbose = False Candle Size Multiplier = 1 Volatility Threshold Over = True Period = 10 Threshold = 0.4

[[Bollinger Bands]] Verbose = False Candle Size Multiplier = 1 Period = 20

[[Bollinger Bandwidth]] Verbose = False

Uses Bollinger Bands Period. Threshold should be adjusted based on

# Candle Size and intended use.
Volatility Threshold Over = True
Threshold = 1

[[Average True Range]] Verbose = False Volatility Threshold Over = True Candle Size Multiplier = 1 Period = 14 Threshold = 10

[[Chandelier Exit]] Verbose = False

We require running long enough for price to pass Short or Long exits before

# determining which trend line to use.
Candle Size Multiplier = 1
Period = 22
Multiplier = 3
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Directional Movement Index]] Verbose = False

Uses ATR period.

# 'Full' uses ADX threshold, and +DI -DI crossovers to determine signal.
# 'DI' uses +DI -DI crossovers to determine signal
# 'Volatility' only uses threshold with ADX as a volatility indicator (must be combined).
Indicator Strategy = Volatility
Volatility Threshold Over = True
# ADX Threshold for 'Volatility' or 'Full' Indicator Strategies
Threshold = 20
[[[Trader]]]
  Trade Volume = 99
  Single Trade = True
  Trade Persist = False
  Trade Delay = 3

[[Simple Rate of Change]] Verbose = False Candle Size Multiplier = 1 Period = 12 [[[Trader]]] Trade Volume = 99 Single Trade = True Trade Persist = False Trade Delay = 3

RealJohnGalt commented 8 years ago

Thank you. You should be good with the latest commit to staging. I really can't believe I missed that.

ghost commented 8 years ago

Thanks, trying it out now. Will keep you posted if I run into the issue again. Thanks for the quick turn around in the midst of a major re-write.

RealJohnGalt commented 8 years ago

No problem. strategies.py won't be changing until presets support is implemented (which is one of the last items planned, even after the guilayer and basic gui).