Fungsi utama
for(var i in exchanges){
var e = exchanges[i];
var trade = new Trade(i);
//Log(typeof(P_vol_p), typeof(P_level));
trade.level = getPara(P_level, i);
trade.vol_u = P_vol_u;
trade.contract_value = getPara(P_contract_value, i);
trade.precision_price = getPara(P_precision_price, i);
trade.precision_vol = getPara(P_precision_vol, i);
trade.pos_vol = 0
trade.pos_price = 0;
tradeArr.push(trade);
e.SetContractType("swap");
e.SetMarginLevel(P_level);
if(!IsVirtual() ){
if(!symbolArr)
var symbolArr = $.get_symbol_arr(e);
trade.precision_price = symbolArr[e.GetCurrency()].precision_price;
trade.precision_vol = symbolArr[e.GetCurrency()].precision_vol;
trade.contract_value = symbolArr[e.GetCurrency()].contract_value;
trade.min_qty = symbolArr[e.GetCurrency()].min_qty;
trade.min_val = symbolArr[e.GetCurrency()].min_val;
}
e.SetPrecision(trade.precision_price, trade.precision_vol)
Log("设置精度", trade.precision_price, trade.precision_vol);
e.SetMaxBarLen(500)
}
RumputJika Anda memilih direktori, Anda menggunakan fungsi $.get_symbol_arr