forked from gazbert/bxbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exchange.xml
99 lines (83 loc) · 7.04 KB
/
exchange.xml
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
<?xml version="1.0"?>
<!--
Exchange Adapter config.
See the README "How do I write my own Exchange Adapter?" section for more details.
All elements are mandatory unless stated otherwise.
BX-bot only supports 1 <adapter> per running instance of the bot at present.
Only 1 exchange element can be specified.
Sample config below currently set to run using the Test Exchange Adapter - it only makes public API calls to Bitstamp.
-->
<exchange>
<!--
A friendly name for the Exchange. It is used in log statements and by BX-bot UI to display the Exchange name.
Value must be an alphanumeric string. Spaces are allowed.
-->
<name>Test Bitstamp Exchange</name>
<!--
For the adapter value, you must specify the fully qualified name of your Exchange Adapter class so the Trading Engine
can load and execute it. The class must be on the runtime classpath.
-->
<adapter>com.gazbert.bxbot.exchanges.TestExchangeAdapter</adapter>
<!--
Add your Bitstamp trading API credentials here. See https://www.bitstamp.net/api/ - API Authentication.
-->
<authentication-config>
<config-item>
<name>client-id</name>
<value>your-client-id</value>
</config-item>
<config-item>
<name>key</name>
<value>your-api-key</value>
</config-item>
<config-item>
<name>secret</name>
<value>your-secret-key</value>
</config-item>
</authentication-config>
<network-config>
<!--
This value is in SECONDS. It is the timeout value that the exchange adapter will wait on socket connect/socket read
when communicating with the exchange. Once this threshold has been breached, the exchange adapter will give up and
throw a Trading API TimeoutException.
The exchange adapter is single threaded: if one request gets blocked, it will block all subsequent requests from
getting to the exchange. This timeout prevents an indefinite block.
You'll need to experiment with values here.
-->
<connection-timeout>30</connection-timeout>
<!-- Optional HTTP status codes that will trigger the adapter to throw a non-fatal ExchangeNetworkException
if the exchange returns any of the below in an API call response: -->
<non-fatal-error-codes>
<code>502</code>
<code>503</code>
<code>504</code>
<code>520</code>
<code>522</code>
<code>525</code>
</non-fatal-error-codes>
<!--
Optional java.io exception messages that will trigger the adapter to throw a non-fatal ExchangeNetworkException
if the exchange returns any of the below in an API call response:
-->
<non-fatal-error-messages>
<message>Connection reset</message>
<message>Connection refused</message>
<message>Remote host closed connection during handshake</message>
<message>Unexpected end of file from server</message>
</non-fatal-error-messages>
</network-config>
<!--
Optional config for adapter - it's not needed for Bitstamp and <optional-config> could be omitted.
Included here to show example usage.
-->
<optional-config>
<config-item>
<name>example-item</name>
<value>some value</value>
</config-item>
<config-item>
<name>anoptional-example-item</name>
<value>0.5</value>
</config-item>
</optional-config>
</exchange>