策略参数配置了交易对基础信息 如下, 用js如何解析,最起码能够拿到键和值。 { ”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 } } }
尝试用在HTML可以,在 发明者量化 出错,拿不到值。 代码: function main(){ Log(parameter); for (var i in parameter) { for (var j in parameter[i]) { for (var k in parameter[i][k]) { Log(“遍历的k:” + k + “==” + parameter[i][j][k]); } } } } 打印信息:
时间 平台 类型 价格 数量 信息 2018-06-04 00:00:00 信息 { “bigone”:{ “BTC/USDT”:{ “enable”:0, “amount_prec”:5,