Commit 44c746aa by rongjun

bug

parent 1b1498c2
...@@ -66,8 +66,8 @@ class BiboxCollector extends BaseCollector{ ...@@ -66,8 +66,8 @@ class BiboxCollector extends BaseCollector{
// restSymbols.push(symbol); // restSymbols.push(symbol);
// } // }
// } // }
const perInterval = 6; const perInterval = 10;
const totalInterval = perInterval * restSymbols.length+50; const totalInterval = perInterval * restSymbols.length;
setInterval(()=>{ setInterval(()=>{
const sortedSymbols = restSymbols.sort(()=>{ const sortedSymbols = restSymbols.sort(()=>{
return Math.random()>0.5 return Math.random()>0.5
...@@ -121,7 +121,7 @@ class BiboxCollector extends BaseCollector{ ...@@ -121,7 +121,7 @@ class BiboxCollector extends BaseCollector{
return symbolDetail.pair; return symbolDetail.pair;
} }
getFeeRate(fromCurrency,toCurrency){ getFeeRate(fromCurrency,toCurrency){
return 0; return 0.001;
} }
processAmount(fromCurrency,toCurrency,amount){ processAmount(fromCurrency,toCurrency,amount){
//有可能会由于数值过小,传进来的amount被表示为科学计数法法 //有可能会由于数值过小,传进来的amount被表示为科学计数法法
...@@ -141,8 +141,9 @@ class BiboxCollector extends BaseCollector{ ...@@ -141,8 +141,9 @@ class BiboxCollector extends BaseCollector{
return price; return price;
} }
getCurrencyMaxReturnAmount(currency){ getCurrencyMaxReturnAmount(currency){
const balance = this.getCurrencyBalance(currency); return Strategy3MaxAmountMap[currency];
return Math.min(Strategy3MaxAmountMap[currency],balance); // const balance = this.getCurrencyBalance(currency);
// return Math.min(Strategy3MaxAmountMap[currency],balance);
} }
getDepthPrintStr(fromCurrency,toCurrency,depth=1){ getDepthPrintStr(fromCurrency,toCurrency,depth=1){
return super.getDepthPrintStr(fromCurrency,toCurrency,3); return super.getDepthPrintStr(fromCurrency,toCurrency,3);
......
...@@ -244,6 +244,7 @@ class Strategy3 { ...@@ -244,6 +244,7 @@ class Strategy3 {
const buyFirst = result[9]; const buyFirst = result[9];
if (totalMarginRate > this._getMinMargin()) { if (totalMarginRate > this._getMinMargin()) {
console.log(`发现利差:${totalMarginRate},buyDepth:${buyDepth},sellDepth${sellDepth},returnDepth${returnDepth}`); console.log(`发现利差:${totalMarginRate},buyDepth:${buyDepth},sellDepth${sellDepth},returnDepth${returnDepth}`);
return -1;
return [baseCurrency1, midCurrency, baseCurrency2, totalMarginRate, buyPrice, sellPrice, returnPrice, amount, returnAmount, rawBuyPrice, rawSellPrice, rawReturnPrice, buyFirst]; return [baseCurrency1, midCurrency, baseCurrency2, totalMarginRate, buyPrice, sellPrice, returnPrice, amount, returnAmount, rawBuyPrice, rawSellPrice, rawReturnPrice, buyFirst];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment