forked from crypto-chassis/ccapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.env.example
158 lines (114 loc) · 7.35 KB
/
config.env.example
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
# The code uses a simplified version of Avellaneda & Stoikov’s inventory strategy. The market making buy/sell order price is
# controlled by SPREAD_PROPORTION_MINIMUM, SPREAD_PROPORTION_MAXIMUM, and the available base/quote capital via a linear
# relationship. The price moves from
# SPREAD_PROPORTION_MINIMUM to SPREAD_PROPORTION_MAXIMUM when the inventory moves from INVENTORY_BASE_QUOTE_RATIO_TARGET to
# one asset completely depleted. The market making buy/sell
# order quantity is controlled by ORDER_QUANTITY_PROPORTION and the available total capital.
# See https://medium.com/open-crypto-market-data-initiative/simplified-avellaneda-stoikov-market-making-608b9d437403 for
# more details.
# In live trade, paper trade, and backtest mode, the program saves private data as CSV files in PRIVATE_DATA_DIRECTORY for
# performance analysis.
# For paper trade mode and backtest mode, see section "only applicable to paper trade and backtest" below to set additional
# parameters. Simulated order matching for market making order is based on real trades from the live market. See
# https://medium.com/open-crypto-market-data-initiative/the-nitty-gritty-of-paper-trading-a-market-making-strategy-792e08116296
# for more details. Simulated order matching for market taking order is based on real order books from the live market.
# For backtest mode, see section "only applicable to backtest" below to set additional parameters. The program expects daily
# historical market data CSV files in HISTORICAL_MARKET_DATA_DIRECTORY with the following names and formats. For example,
# File name: gemini__eth-usd__2021-07-01__market-depth.csv. This file contains BBO data at each second. OK to be sparse, meaning
# a missing second is assumed to contain the same data as its previous second.
# File format:
# time_seconds,bid_price_bid_size,ask_price_ask_size
# 1625097600,2271.58_1.6477,2279.63_28.479526
# ...
# File name: gemini__eth-usd__2021-07-01__trade.csv. This file contains trade data for every tick.
# File format:
# time_seconds,price,size,is_buyer_maker
# 1625097621.647,2278.15,0.0409,1
# ...
# You can choose to get the data from any vendor.
# 'live': Live trade.
# 'paper': Paper trade.
# 'backtest': Backtest.
TRADING_MODE=live
EXCHANGE=coinbase
INSTRUMENT=BTC-USD
# If set to e.g. 0.1, only 10% of the base asset's total available balance will be used as base available capital.
BASE_AVAILABLE_BALANCE_PROPORTION=1
# If set to e.g. 0.1, only 10% of the quote asset's total available balance will be used as quote available capital.
QUOTE_AVAILABLE_BALANCE_PROPORTION=1
# The desired ratio of base asset value against quote asset value.
INVENTORY_BASE_QUOTE_RATIO_TARGET=1
# If set to true, use weighted mid price as mid price.
# https://quant.stackexchange.com/questions/50651/how-to-understand-micro-price-aka-weighted-mid-price
USE_WEIGHTED_MID_PRICE=false
# If set to e.g. 0.001 ( = 0.1%), the corresponding price will be 0.1% away from the mid price.
SPREAD_PROPORTION_MINIMUM=0.001
# If set to e.g. 0.02 ( = 2%), the corresponding price will be 2% away from the mid price.
# If set to be the same as SPREAD_PROPORTION_MINIMUM, the strategy effectively reduces to naive market making.
SPREAD_PROPORTION_MAXIMUM=0.02
# If set to e.g. 0.1, a single buy or sell order's quantity will use 10% of total available capital ( = base available
# capital + quote available capital).
# If set to 0.5, it is effectively a ping-pong strategy.
ORDER_QUANTITY_PROPORTION=0.1
# If set to e.g. 15, orders will be canceled and replaced after 15 seconds.
ORDER_REFRESH_INTERVAL_SECONDS=15
# If set to a non-negative value e.g. 1, and ORDER_REFRESH_INTERVAL_SECONDS is set to 15, the market making period will
# always start at 1, 16, 31, 46 seconds of the minute. This feature is useful to avoid exchange API rate limit when market
# making using the same API key.
ORDER_REFRESH_INTERVAL_OFFSET_SECONDS=-1
# If set to true, the program will update the order book states tick-by-tick. This is only needed if the typical BBO tick-to-tick time
# of the market you are competing in is less than your typical round trip network latency.
ENABLE_UPDATE_ORDER_BOOK_TICK_BY_TICK=false
# If set to true, the program will immediately place new orders once all of the existing orders are completely filled. It is
# incompatible with ORDER_REFRESH_INTERVAL_OFFSET_SECONDS
IMMEDIATELY_PLACE_NEW_ORDERS=false
# Some exchanges cache account balances. Therefore after canceling all open orders, we'd wait a little bit for the held
# funds to be released. Must be less than ORDER_REFRESH_INTERVAL_SECONDS.
ACCOUNT_BALANCE_REFRESH_WAIT_SECONDS=1
# If the exchange supports subaccount and you want to use it.
ACCOUNT_ID=''
# The program saves private data (e.g. balances, trades, orders) as CSV files. This value specifies the directory in which these
# files are saved. Leave empty if you want to use current working directory. For each day a new file is generated per data type.
PRIVATE_DATA_DIRECTORY=''
# This value specifies the name prefix of the files in which private data are saved.
PRIVATE_DATA_FILE_PREFIX=''
# This value specifies the name suffix of the files in which private data are saved.
PRIVATE_DATA_FILE_SUFFIX=''
# The application's start time, e.g. 2021-08-22T00:00:00Z. Optional, defaults to now.
START_TIME=''
# The application's total duration in seconds. When reached, the application will exit. Optional, defaults to infinity.
TOTAL_DURATION_SECONDS=0
# If set to e.g. 0.1, then at any moment if the maximum drawdown is larger than 10%, the program will cancel all open orders and terminate itself.
KILL_SWITCH_MAXIMUM_DRAWDOWN=0.1
# start: only applicable to paper trade and backtest
# Hypothetical initial base asset balance
INITIAL_BASE_BALANCE=0
# Hypothetical initial quote asset balance
INITIAL_QUOTE_BALANCE=10000
# If set to e.g. 0.001, for a maker each trade will carry a fee of 0.1% of the transacted value.
MAKER_FEE=0.001
# If set to e.g. USD, for a maker buyer the trading fee is charged in USD.
MAKER_BUYER_FEE_ASSET=USD
# If set to e.g. USD, for a maker seller the trading fee is charged in USD.
MAKER_SELLER_FEE_ASSET=USD
# A number between 0 and 1 to express how much impact your own orders might affect the market.
MARKET_IMPACT_FACTOR=0.5
# end: only applicable to paper trade and backtest
# start: only applicable to backtest
# The historical market data start date, e.g. 2021-08-22.
HISTORICAL_MARKET_DATA_START_DATE=''
# The historical market data end date, e.g. 2021-08-23. Exclusive.
HISTORICAL_MARKET_DATA_END_DATE=''
# The directory in which historical market data files are saved.
HISTORICAL_MARKET_DATA_DIRECTORY=''
# This value specifies the name prefix of the files in which historical market data are saved. For example, if set to "chassis__"
# File name: chassis__gemini__eth-usd__2021-07-01__market-depth.csv.
# File name: chassis__gemini__eth-usd__2021-07-01__trade.csv.
HISTORICAL_MARKET_DATA_FILE_PREFIX=''
# This value specifies the name suffix of the files in which historical market data are saved. For example, if set to "__chassis"
# File name: gemini__eth-usd__2021-07-01__market-depth__chassis.csv.
# File name: gemini__eth-usd__2021-07-01__trade__chassis.csv.
HISTORICAL_MARKET_DATA_FILE_SUFFIX=''
# If set to true, the program only saves a single final summary of private data rather than several detailed files. Use this option to increase backtest speed.
PRIVATE_DATA_ONLY_SAVE_FINAL_SUMMARY=false
# end: only applicable to backtest