Commit 00288042 by rongjun

bug

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