Commit 477d3572 by zihan

风险过高的单,放弃

parent 6a3795e4
...@@ -138,6 +138,15 @@ class BiboxStrategy3 extends Strategy3 { ...@@ -138,6 +138,15 @@ class BiboxStrategy3 extends Strategy3 {
_getMinMargin(){ _getMinMargin(){
return 0.08; return 0.08;
} }
_giveUpOrder(baseCurrency1, midCurrency, baseCurrency2,totalMarginRate,buyDepth,sellDepth){
const sellDepth = this.collector.getDepth(midCurrency, baseCurrency2, 2);
const possibleLoss = (sellDepth[0][1] - sellDepth[1][1])/sellDepth[0][1];
if(possibleLoss > totalMarginRate){
console.log(`此单风险过高,放弃。损失率${possibleLoss}`);
return true;
}
return super._giveUpOrder(baseCurrency1,midCurrency,baseCurrency2,totalMarginRate,buyDepth,sellDepth);
}
_needConsiderDepthCount(){ _needConsiderDepthCount(){
return [[2,1],[3,2,1],[2,1]]; return [[2,1],[3,2,1],[2,1]];
......
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