forked from brndnmtthws/thetagang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththetagang.toml
161 lines (134 loc) · 4.79 KB
/
thetagang.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# NOTE: It is STRONGLY recommended you read through all notes, config options,
# and documentation before proceeding. Be sure to update the configuration
# values according to your preferences. Additionally, any default values in
# this config do not constitute a recommendation or endorsement, or any provide
# claims abount returns or performance.
#
# Should you decide to use ThetaGang, please experiment with a paper trading
# account before trying on a live account.
[account]
# The account number to operate on
number = "DU1234567"
# Cancel any existing orders for the symbols configured at startup
cancel_orders = true
# Maximum amount of margin to use, as a ratio of net liquidation. IB lets
# you use varying amounts of margin, depending on the assets. To use up to 4x
# margin, set this to 4. It's recommended you always leave some additional
# cushion. IB will start to close positions if you go below certain thresholds
# of available margin in your account.
#
# For details on margin usage, see:
# https://www.interactivebrokers.com/en/index.php?f=24176
#
# The default value uses 50% of your available net liquidation value
# (i.e., half of your funds). Set this to 1.0 to use all your funds,
# or 1.5 to use 150% (which may incur margin interest charges).
margin_usage = 0.5
# Market data type (see
# https://interactivebrokers.github.io/tws-api/market_data_type.html)
market_data_type = 1
[option_chains]
# Number of expirations to load from option chains
expirations = 5
# Number of strikes to load from option chains
strikes = 50
[roll_when]
# Roll when P&L reaches 90%
pnl = 0.9
# Or, roll options when there are <= 15 days to expiry and P&L is at least
# min_pnl (min_pnl defaults to 0)
#
# NOTE: For cases where an option ends up deep ITM, notably when selling
# covered calls, it's possible that the P&L would be significantly negative,
# i.e., -100%. If you want to roll anyway in these situations, set min_pnl to a
# negative value such as -1 (for -100%).
dte = 15
min_pnl = 0.0
[roll_when.calls]
# Roll calls to the next expiration even if they're in the money. Defaults to
# true if not specified.
itm = true
[roll_when.puts]
# Roll puts if they're in the money. Defaults to false if not specified.
itm = false
[target]
# Target 45 or more days to expiry
dte = 45
# Target delta of 0.3 or less. Defaults to 0.3 if not specified.
delta = 0.3
# When writing new contracts (either covered calls or naked puts), never write
# more than this number of contracts at once. This can be useful to spread the
# contracts out over time in order to protect yourself from large swings. This
# value does not affect rolling existing contracts to the next expiration.
# Defaults to 15 if not specified.
maximum_new_contracts = 15
# Minimum amount of open interest for a contract to qualify
minimum_open_interest = 10
# Optional: specify delta separately for puts/calls. Takes precedent over
# target.delta.
#
# [target.puts]
# delta = 0.5
# [target.calls]
# delta = 0.3
[symbols]
# NOTE: Please change these symbols and weights according to your preferences.
# These are provided only as an example for the purpose of configuration. These
# values were chosen as sane values should someone decide to run this code
# without changes, however it is in no way a recommendation or endorsement.
#
# You should try to choose ETFs or stocks that:
#
# 1) Have sufficient trading volume for the underlying
# 2) Have standard options contracts (100 shares per contract)
# 3) Have options with sufficient open interest and trading volume
#
# The target delta may also be specified per-symbol, and takes precedence over
# `target.delta` or `target.puts/calls.delta`. You can specify a value for the
# symbol, or override individually for puts/calls.
[symbols.SPY]
weight = 0.4
[symbols.QQQ]
weight = 0.3
[symbols.QQQ.puts]
# Override delta just for QQQ puts
delta = 0.5
[symbols.TLT]
weight = 0.3
# Override delta for this particular symbol, for both puts and calls.
delta = 0.4
[ib_insync]
logfile = '/etc/thetagang/ib_insync.log'
[ibc]
# IBC configuration parameters. See
# https://ib-insync.readthedocs.io/api.html#ibc for details.
gateway = true
ibcPath = '/opt/ibc'
tradingMode = 'paper'
password = 'demo'
userid = 'demo'
# Change this to point to your config.ini for IBC
ibcIni = '/etc/thetagang/config.ini'
# Change or unset this to use something other than the Docker bundled OpenJDK.
javaPath = '/opt/java/openjdk/bin'
# twsPath = ''
# twsSettingsPath = ''
# fixuserid = ''
# fixpassword = ''
[watchdog]
# Watchdog configuration params. See
# https://ib-insync.readthedocs.io/api.html#watchdog for details.
appStartupTime = 30
appTimeout = 20
clientId = 1
connectTimeout = 2
host = '127.0.0.1'
port = 4002
probeTimeout = 4
readonly = false
retryDelay = 2
[watchdog.probeContract]
currency = 'USD'
exchange = 'SMART'
secType = 'STK'
symbol = 'SPY'