Los parámetros de la estrategia configuran la información básica de la pareja de transacciones de la siguiente manera:
{
"bigone":{
"BTC/USDT":{
"enable":0,
"amount_prec":5,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.01,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
},
"EOS/BTC":{
"amount_prec":1,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":5,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"EOS/USDT":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":5,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
},
"ETC/BTC":{
"amount_prec":2,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":4,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"ETH/BTC":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"ETH/EOS":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":1,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":1,
"sell_fee_ratio":0.001
},
"ETH/USDT":{
"enable":0,
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
}
}
}
En el caso de que se trate de usar en HTML puede, en la cuantificación del inventor falla, no se obtiene el valor.
Código:
function main(){
Log(parameter);
for (var i in parameter) {
for (var j in parameter[i]) {
for (var k in parameter[i][k]) {
Log ((" recorrido por k:" + k + "==" + parameter[i][j][k]);
}
}
}
}
Información para imprimir:
Tiempo Plataforma Tipo Precio cantidad Información
El precio de la moneda es el mismo que el precio del dólar.
function Iterator(dict, name){
if(typeof(dict) !== "object"){
Log(name, " : ", dict)
return
}else{
Log(name, "#FF0000")
}
for(var k in dict){
Iterator(dict[k], k)
}
}
function main() {
var jsonObj = {
"bigone": {
"BTC/USDT": {
"enable": 0,
"amount_prec": 5,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 0.01,
"mintrd": 10,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 3,
"sell_fee_ratio": 0.001
},
"EOS/BTC": {
"amount_prec": 1,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 5,
"mintrd": 0.001,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 8,
"sell_fee_ratio": 0.001
},
"EOS/USDT": {
"amount_prec": 4,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 5,
"mintrd": 10,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 3,
"sell_fee_ratio": 0.001
},
"ETC/BTC": {
"amount_prec": 2,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 4,
"mintrd": 0.001,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 8,
"sell_fee_ratio": 0.001
},
"ETH/BTC": {
"amount_prec": 4,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 0.1,
"mintrd": 0.001,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 8,
"sell_fee_ratio": 0.001
},
"ETH/EOS": {
"amount_prec": 4,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 0.1,
"mintrd": 1,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 1,
"sell_fee_ratio": 0.001
},
"ETH/USDT": {
"enable": 0,
"amount_prec": 4,
"buy_fee_ratio": 0.001,
"delay_threshold": 300,
"depth_ratio": 0.2,
"maxtrd_amount": 0.1,
"mintrd": 10,
"mintrd_type": "quote",
"pause_rounds": 5,
"price_prec": 3,
"sell_fee_ratio": 0.001
}
}
}
Iterator(jsonObj)
}
写了个简单的, 可能不完善,参考下。
- 1

