Commit 00288042 by rongjun

bug

parent 087491bb
...@@ -225,24 +225,24 @@ class BaseCollector { ...@@ -225,24 +225,24 @@ class BaseCollector {
runStrategy3(){ runStrategy3(){
console.log("启动成功"); console.log("启动成功");
this._fetchSymbols(this._handleFetchSymbolResult.bind(this)); this._fetchSymbols(this._handleFetchSymbolResult.bind(this));
setInterval(()=>{ // setInterval(()=>{
redisClient.get(this.machine + "_STOP", (err, value) => { // redisClient.get(this.machine + "_STOP", (err, value) => {
if (value) { // if (value) {
this.allowTrade = false; // this.allowTrade = false;
console.log("滑点过多,停止交易"); // console.log("滑点过多,停止交易");
} else { // } else {
this.allowTrade = true; // this.allowTrade = true;
} // }
}); // });
},1000 *10); // },1000 *10);
setInterval(()=>{ // setInterval(()=>{
this._runMonitor((data)=>{ // this._runMonitor((data)=>{
if(data){ // if(data){
this.balanceMap = {...data}; // this.balanceMap = {...data};
redisClient.set(this.machine,JSON.stringify(this.balanceMap),"EX",30); // redisClient.set(this.machine,JSON.stringify(this.balanceMap),"EX",30);
} // }
}); // });
},this._runMonitorInterval()); // },this._runMonitorInterval());
} }
runStrategy2(){ runStrategy2(){
......
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