Repository navigation
Expand file tree
/
Copy pathsettings.js
More file actions
executable file
·272 lines (261 loc) · 10.8 KB
/
Copy pathsettings.js
File metadata and controls
executable file
·272 lines (261 loc) · 10.8 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
const ccxt = require ('ccxt')
require ('./therocksqv.js')
var accounts = require ('./credentials-1.json')
const ids = ccxt.exchanges.filter (id => id in accounts)
let marketNames = [];
const SALESMANX_EXCHANGE="binance"
const SALESMANX_COIN ="ETH"
const SALESMANX_PROFIT=0.001
const SALESMANX_STOPLOSS=0.003
const SALESMANX_STOPLOSS_COUNTER=20
const SALESMANX_WALLET_QUANTITY_PERCENTAGE=100
const SALESMANX_WALLET_ENABLED=false
const SALESMANX_WALLET_DIVIDER=1
const SALESMANX_OHLCV_PERIOD='1m'
const SALESMANX_COIN_FEE_AUTOCHARGE=true
const SALESMANX_COIN_FEE='BNB'
const SALESMANX_COIN_FEE_CHARGE=3
const SALESMANX_COIN_FEE_THRESHOLD=0.5
const SALESMANX_OB_LEVEL=16
const SALESMANX_ORDERBOOK_FILTER = true;
//CONSTANTs
//CDC2 CONSTANTS
//RSI, BB, ADX = TRUE;TI=FALSE
const CDC2_EXCHANGE="binance"
const CDC2_COIN ="ETH"
const CDC2_PROFIT=0.0025
const CDC2_STOPLOSS=0.05
const CDC2_STOPLOSS_TIMEWINDOWS=1 //mins
const CDC2_STOPLOSS_COUNTER=20
const CDC2_WALLET_QUANTITY_PERCENTAGE=100
const CDC2_WALLET_ENABLED=false
const CDC2_WALLET_DIVIDER=2
const CDC2_OHLCV_PERIOD='1m'
const CDC2_COIN_FEE_AUTOCHARGE=true
const CDC2_COIN_FEE='BNB'
const CDC2_COIN_FEE_CHARGE=1.5
const CDC2_COIN_FEE_THRESHOLD=0.5
const CDC2_OB_LEVEL=16
const CDC2_ORDERBOOK_FILTER = true;
const CDC2_TREND_DIRECTIONL='upper' //lower, negative | upper, positive
const CDC2_PRICE_CHANGED='neutral' //lower (-%), upper(+%), neutral(-,+ %)
const CDC2_MAX_PROFIT=0.01
//SALESMAN CONSTANTS
//RSI, ADX = TRUE; BB, TI=FALSE
const SALESMAN_EXCHANGE="binance"
const SALESMAN_COINPAIR ="ETH/BTC"
const SALESMAN_PROFIT=0.0015 //price = priceLast * (1 - SALESMAN_PROFIT);
const SALESMAN_STOPLOSS=0.003
const SALESMAN_STOPLOSS_COUNTER=20
const SALESMAN_WALLET_QUANTITY_PERCENTAGE=100
const SALESMAN_WALLET_ENABLED=false
const SALESMAN_WALLET_DIVIDER=1
const SALESMAN_OHLCV_PERIOD='5m'
const SALESMAN_COIN_FEE='BNB'
const SALESMAN_COIN_FEE_CHARGE=1.5
const SALESMAN_COIN_FEE_AUTOCHARGE=true
const SALESMAN_COIN_FEE_THRESHOLD=0.5
const SALESMAN_OB_LEVEL=16
const SALESMAN_ORDERBOOK_FILTER = false;
const SALESMAN_STOPLOSS_TIMEWINDOWS=1 //mins
//INTRA EXCHANGE ARBITRAGE CONSTATNTs
const ARBITRAGE_EXCHANGE="binance"
const ARBITRAGE_EXCHANGE_COIN="ETH"
const ARBITRAGE_EXCHANGE_MULTIPLE_COINS="BNB,ETH"
const ARBITRAGE_EXCHANGE_WALLET_ENABLED=true // TRUE if the entirety of wallet is the amount for the single order; false otherwise
const ARBITRAGE_EXCHANGE_WALLET_LIMIT=0.8 // the upper bound/limit of wallet amount to be ordered
const ARBITRAGE_WALLET_QUANTITY_PERCENTAGE=100
const ARBITRAGE_EXCHANGE_WALLET_DIVIDER=2 // the upper bound/limit of wallet amount to be ordered
const ARBITRAGE_MULTIPLE_WALLET=false //TRUE if the arbitrage uses multiple wallet for giong faster during the order on exchange - parallel orders; false otherwise - is a default values
const ARBITRAGE_OHLCV_PERIOD='1m'
const ARBITRAGE_OB_LEVEL=32
const ARBITRAGE_ORDERBOOK_FILTER = false;
const ARBITRAGE_STOPLOSS=0.003
const ARBITRAGE_STOPLOSS_COUNTER = 20
//mins
const ARBITRAGE_STOPLOSS_TIMEWINDOWS=1 //mins
const STOPLOSS_ENABLED=false
const USDT_COIN_QUANTITY=1000
const ETH_COIN_QUANTITY=0.10
const BTC_COIN_QUANTITY=0.01
const ENABLE_RATE_LIMIT = true
const ARBITRAGE_CRITERIA = 'last' //ARBITRAGE_CRITERIA (buy, sell)::=bid_ask|last|ask_bid
const DEBUG = false;
const COUNT_OPPORTUNITIES = false;
const OPPORTUNITIES_SIDE = "oneway"; //OPPORTUNITIES_SIDE::="oneway"|"roundtrip"
const ARBITRAGE_ENGINE = "manual"; //ARBITRAGE_ENGINE::="manual"| "automatic" // TO BE COMPLETED
//FILTER -- SKIP everythings is amout, cost and price are below the limit provided
const LIMIT_FILTER = true;
const VOLUME_FILTER = true;
const SPREAD_FILTER = true;
const SPREAD_THRESHOLD = 0.15;
const SPREAD_HIGH_LOW_THRESHOLD=10
const SPREAD_HIGH_LOW_LEVEL=2 //level based on decili scale (1, 2,..., 10)
const SPREAD_HL_FILTER=true
//Technical Indicator
const TI_FILTER = false;
// see: https://tradingsim.com/blog/adx/
// see: https://www.ig.com/it/adx-come-individuare-trend
const ADX_FILTER = true;
//BARELY BREATHING
const ADX_LEVEL_1 = 0
//WEAK TREADING
const ADX_LEVEL_2 = 10
//POTENTIALLY STARTING TO TREND
const ADX_LEVEL_3 = 20
//HEATING UP
const ADX_LEVEL_4 = 30
//WATCH OUT
const ADX_LEVEL_5 = 50
//ONFIRE
const ADX_LEVEL_6 = 75
//ONFIRE
const ADX_LEVEL_7 = 100
//BB
//see: https://www.opzionibinarie60.com/strategia-del-retest-sulle-bande-di-bollinger-a-120-secondi/
const BB_FILTER = false //true for ARBITRAGE and CDC2, CDC3. false for salesman
//see: http://webinary24.com/binary-trading-strategy-triple-rsi/
//see: https://www.e-investimenti.com/trading-online/20212-trading-un-mercato-laterale-trading-senza-trend/
const RSI_FILTER = true;
const RSI_OVERSOLD = 40 //30 as default
const RSI_OVERBOUGHT = 80 //70 as default
//MFI Technical Indicator
const MFI_FILTER = false;
const MFI_OVERSOLD = 40
const MFI_OVERBOUGHT = 80
//CCI Technical Indicator
const CCI_FILTER = false;
const CCI_OVERSOLD = -100
const CCI_OVERBOUGHT = 200
// CROSS and INTRA EXCHANGE ARBITRAGE
// VOLUME IN $(USD) See: https://coinmarketcap.com/exchanges/volume/24-hour/ based on exchanged configured on crime
const VOLUME_THRESHOLD = 190278;//i.e.:x100 amout as default.
const SLIPPAGE_ALLOWED =0.0005 // I don't like this kind of engagmenet for the order (buy + SLIPPAGE_ALLOWE, sell - SLIPPAGE_ALLOWE)
const STUB = false;
//just for stub i.e. the idea is to analyze opportunities with a wallet equals to 1001 USD i.e.: for BTC as altcoin the wallet amout is 0.10; ETH = 1.15
//coin:ZEC amount:2.54 coin:neo amount:7.89
let sqvAmount =0.6, sqvCoin="BTC"
const version = 0.3
const FETCH_TYPE = "tickers"; //FETCH_TYPE::="ticker"|"tickers"
let proxies = [
'', // no proxy by default
'http://localhost:8080/',
//'https://cors-anywhere.herokuapp.com/',
]
let maxRetries = proxies.length
let currentProxy = 0
for (let i = 0; i < ids.length; i++) {
marketNames.push([[ids[i]], ['']])
}
module.exports = function () {
this.marketNames = marketNames;
this.ENABLE_RATE_LIMIT = ENABLE_RATE_LIMIT
this.ARBITRAGE_CRITERIA =ARBITRAGE_CRITERIA;
this.DEBUG = DEBUG
this.COUNT_OPPORTUNITIES = COUNT_OPPORTUNITIES
this.FETCH_TYPE = FETCH_TYPE
this.ARBITRAGE_ENGINE = ARBITRAGE_ENGINE
this.OPPORTUNITIES_SIDE = OPPORTUNITIES_SIDE
this.LIMIT_FILTER = LIMIT_FILTER
this.TI_FILTER=TI_FILTER
this.RSI_FILTER=RSI_FILTER
this.RSI_OVERSOLD = RSI_OVERSOLD
this.RSI_OVERBOUGHT=RSI_OVERBOUGHT
this.MFI_FILTER=MFI_FILTER
this.MFI_OVERSOLD = MFI_OVERSOLD
this.MFI_OVERBOUGHT=MFI_OVERBOUGHT
this.CCI_FILTER=CCI_FILTER
this.CCI_OVERSOLD = CCI_OVERSOLD
this.CCI_OVERBOUGHT=CCI_OVERBOUGHT
this.ADX_FILTER=ADX_FILTER
this.ADX_LEVEL_1=ADX_LEVEL_1
this.ADX_LEVEL_2=ADX_LEVEL_2
this.ADX_LEVEL_3=ADX_LEVEL_3
this.ADX_LEVEL_4=ADX_LEVEL_4
this.ADX_LEVEL_5=ADX_LEVEL_5
this.ADX_LEVEL_6=ADX_LEVEL_6
this.ADX_LEVEL_7=ADX_LEVEL_7
this.BB_FILTER=BB_FILTER
this.STOPLOSS_ENABLED=STOPLOSS_ENABLED
this.VOLUME_FILTER = VOLUME_FILTER
this.VOLUME_THRESHOLD=VOLUME_THRESHOLD
this.SLIPPAGE_ALLOWED = SLIPPAGE_ALLOWED
this.SPREAD_FILTER=SPREAD_FILTER
this.SPREAD_THRESHOLD=SPREAD_THRESHOLD
this.ARBITRAGE_EXCHANGE_WALLET_ENABLED=ARBITRAGE_EXCHANGE_WALLET_ENABLED
this.ARBITRAGE_EXCHANGE_WALLET_LIMIT=ARBITRAGE_EXCHANGE_WALLET_LIMIT
this.ARBITRAGE_EXCHANGE_WALLET_DIVIDER=ARBITRAGE_EXCHANGE_WALLET_DIVIDER
this.ARBITRAGE_STOPLOSS_TIMEWINDOWS
this.ARBITRAGE_WALLET_QUANTITY_PERCENTAGE=ARBITRAGE_WALLET_QUANTITY_PERCENTAGE
this.STUB = STUB
this.sqvAmount=sqvAmount
this.sqvCoin=sqvCoin
this.version = version
this.proxies=proxies
this.maxRetries=maxRetries
this.currentProxy=currentProxy
this.SPREAD_HIGH_LOW_THRESHOLD=SPREAD_HIGH_LOW_THRESHOLD
this.SPREAD_HL_FILTER=SPREAD_HL_FILTER
this.SPREAD_HIGH_LOW_LEVEL=SPREAD_HIGH_LOW_LEVEL
this.ARBITRAGE_EXCHANGE=ARBITRAGE_EXCHANGE
this.ARBITRAGE_EXCHANGE_COIN=ARBITRAGE_EXCHANGE_COIN
this.ARBITRAGE_MULTIPLE_WALLET=ARBITRAGE_MULTIPLE_WALLET
this.ARBITRAGE_EXCHANGE_MULTIPLE_COINS=ARBITRAGE_EXCHANGE_MULTIPLE_COINS
this.ETH_COIN_QUANTITY=ETH_COIN_QUANTITY
this.BTC_COIN_QUANTITY=BTC_COIN_QUANTITY
this.USDT_COIN_QUANTITY=USDT_COIN_QUANTITY
this.ARBITRAGE_OHLCV_PERIOD=ARBITRAGE_OHLCV_PERIOD
this.ARBITRAGE_OB_LEVEL=ARBITRAGE_OB_LEVEL
this.ARBITRAGE_ORDERBOOK_FILTER=ARBITRAGE_ORDERBOOK_FILTER
//SALESMAN ALGO bases on single coinpar
this.SALESMAN_COINPAIR=SALESMAN_COINPAIR
this.SALESMAN_EXCHANGE=SALESMAN_EXCHANGE
this.SALESMAN_PROFIT=SALESMAN_PROFIT
this.SALESMAN_WALLET_QUANTITY_PERCENTAGE=SALESMAN_WALLET_QUANTITY_PERCENTAGE
this.SALESMAN_WALLET_DIVIDER=SALESMAN_WALLET_DIVIDER
this.SALESMAN_OHLCV_PERIOD=SALESMAN_OHLCV_PERIOD
this.SALESMAN_COIN_FEE=SALESMAN_COIN_FEE
this.SALESMAN_COIN_FEE_THRESHOLD=SALESMAN_COIN_FEE_THRESHOLD
this.SALESMAN_COIN_FEE_CHARGE=SALESMAN_COIN_FEE_CHARGE
this.SALESMAN_ORDERBOOK_FILTER=SALESMAN_ORDERBOOK_FILTER
this.SALESMAN_OB_LEVEL=SALESMAN_OB_LEVEL
this.SALESMAN_COIN_FEE_AUTOCHARGE=SALESMAN_COIN_FEE_AUTOCHARGE
this.SALESMAN_STOPLOSS=SALESMAN_STOPLOSS
this.SALESMAN_STOPLOSS_COUNTER=SALESMAN_STOPLOSS_COUNTER
this.SALESMAN_STOPLOSS_TIMEWINDOWS
//SALEMANX ALGO - algo saleman cross asset/symbol
this.SALESMANX_COIN=SALESMANX_COIN
this.SALESMANX_EXCHANGE=SALESMANX_EXCHANGE
this.SALESMANX_PROFIT=SALESMANX_PROFIT
this.SALESMANX_WALLET_QUANTITY_PERCENTAGE=SALESMANX_WALLET_QUANTITY_PERCENTAGE
this.SALESMANX_WALLET_DIVIDER=SALESMANX_WALLET_DIVIDER
this.SALESMANX_OHLCV_PERIOD=SALESMANX_OHLCV_PERIOD
this.SALESMANX_COIN_FEE=SALESMANX_COIN_FEE
this.SALESMANX_COIN_FEE_THRESHOLD=SALESMANX_COIN_FEE_THRESHOLD
this.SALESMANX_COIN_FEE_CHARGE=SALESMANX_COIN_FEE_CHARGE
this.SALESMANX_ORDERBOOK_FILTER=SALESMANX_ORDERBOOK_FILTER
this.SALESMANX_OB_LEVEL=SALESMANX_OB_LEVEL
this.SALESMANX_COIN_FEE_AUTOCHARGE=SALESMANX_COIN_FEE_AUTOCHARGE
this.SALESMANX_STOPLOSS=SALESMANX_STOPLOSS
this.SALESMANX_STOPLOSS_COUNTER=SALESMANX_STOPLOSS_COUNTER
//CDC2
this.CDC2_EXCHANGE=CDC2_EXCHANGE
this.CDC2_COIN=CDC2_COIN
this.CDC2_PROFIT=CDC2_PROFIT
this.CDC2_STOPLOSS=CDC2_STOPLOSS
this.CDC2_STOPLOSS_COUNTER=CDC2_STOPLOSS_COUNTER
this.CDC2_WALLET_QUANTITY_PERCENTAGE=CDC2_WALLET_QUANTITY_PERCENTAGE
this.CDC2_WALLET_ENABLED=CDC2_WALLET_ENABLED
this.CDC2_WALLET_DIVIDER=CDC2_WALLET_DIVIDER
this.CDC2_OHLCV_PERIOD=CDC2_OHLCV_PERIOD
this.CDC2_COIN_FEE_AUTOCHARGE=CDC2_COIN_FEE_AUTOCHARGE
this.CDC2_COIN_FEE=CDC2_COIN_FEE
this.CDC2_COIN_FEE_THRESHOLD=CDC2_COIN_FEE_THRESHOLD
this.CDC2_COIN_FEE_CHARGE=CDC2_COIN_FEE_CHARGE
this.CDC2_OB_LEVEL=CDC2_OB_LEVEL
this.CDC2_ORDERBOOK_FILTER=CDC2_ORDERBOOK_FILTER
this.CDC2_TREND_DIRECTIONL=CDC2_TREND_DIRECTIONL
this.CDC2_PRICE_CHANGED=CDC2_PRICE_CHANGED
this.CDC2_MAX_PROFIT=CDC2_MAX_PROFIT
this.CDC2_STOPLOSS_TIMEWINDOWS=CDC2_STOPLOSS_TIMEWINDOWS
};