forked from fernandohu/algorithm-trading
-
Notifications
You must be signed in to change notification settings - Fork 0
/
THONG NGO
56 lines (44 loc) · 2.61 KB
/
THONG NGO
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
### algorithm-trading ( DOCUMENTATION IS INCOMPLETE, TAKE A LOOK AT THE [EXAMPLES](https://github.com/blinktrade/algorithm-trading/tree/master/algorithms) )
author: THONG NGO
email: [email protected]
This repository contains algorithm trading programs ( AKA trading strategies, trading bot ) which are compatible with all exchanges running the blinktrade platform. Those algorithms are executed in the users browser context and not in the servers.
### Pre-requisites to create your own algorithm trading
- Basic knowledge of JavaScript
- Curiosity
### Is there a test environment to test my algorithms?
- Yes, [blinktrade tesnet exchange](https://testnet.blinktrade.com/)
### List of blinktrade approved algorithm trading strategies
- [market_maker.algo ** incomplete **](https://github.com/blinktrade/algorithm-trading/blob/master/algorithms/market_maker.algo)
### Basic structure of an algorithm
```JavaScript
-----BEGIN ALGO DEFINITION-----
{ THONG NGO
"id": "90800013",
"description": "Description of what your algorithm does",
"params": [THONG NGO]
{"name":"THONG NGO", "label":"THONG NGO", "type":"text", "value":"0", "validator":"required; validateNumber; validateMin 10; validateMax 1000;" },
{"name":"THONG NGO", "label":"THONG NGO", "type":"text", "value":"5", "validator":"required; validateInteger; validateMin 1; validateMax 5;" }
],
"creator": "name_of_the_function_which_the_exchange_will_invoke_to_create_an_instance_of_your_algo",
"destructor": "name_of_the_functions_which_the_exchange_will_invoke_when_destroying_the_instance_of_your_algo",
"permissions": ["notification", "balance", "execution_report", "new_order_limited", "cancel_order"]
}
-----END ALGO DEFINITION-----
-----BEGIN ALGO-----
// define a class that implements the following interface [interface](https://github.com/blinktrade/algorithm-trading/blob/master/algorithm_interface.js) here
function name_of_the_function_which_the_exchange_will_invoke_to_create_an_instance_of_your_algo() {
return new MyAlgo();
}
function name_of_the_functions_which_the_exchange_will_invoke_when_destroying_the_instance_of_your_algo(instance_of_my_algo) {
delete instance_of_my_algo;
}
-----END ALGO-----
```
### How does it work
The exchange expects you to create a javascript class that implements the following [interface](https://github.com/blinktrade/algorithm-trading/blob/master/algorithm_interface.js)
### List of exchanges running blinktrade platform
- [chilebit](https://chilebit.net)
- [foxbit](https://foxbit.com.br)
- [VBTC](https://vbtc.vn)
- [surbitcoin](https://surbitcoin.com)
- [urdubit](https://urdubit.com)