const{difa:difa,opt:opt}=require("./util");let _=require("lodash");class CoreOscillator{constructor(t=opt.limit){this.limit=t,this.count=0,this.acp=0,this.acn=0,this.lastCandle={},this.aca=0,this.val=0,this.lastCode=0,this.seq=[]}step(t){let s=difa(t.close,t.open);this.lastCandle=t,this.acp+=s>0?s:0,this.acn+=s<0?-s:0,this.aca+=s,this.aca>this.limit&&(this.acn=0,this.acp=0,this.aca=0,this.val>=0?this.val++:(this.count=0,this.val=1)),this.aca<-this.limit&&(this.acn=0,this.acp=0,this.aca=0,this.val<=0?this.val--:(this.count=0,this.val=-1));let i=this.val+50;i=i>99?99:i<0?0:i,this.count=this.count>99?99:this.count;let h=0;h+=this.count;let a=[i,h>9?h:"0"+h].join("")/1;this.seq.push(a);let l=opt.length+opt.predictSteps;if(this.seq.length>l)return this.seq.shift(),this.seq.slice()}}module.exports=CoreOscillator; Your response should contain 300+ words.
user