1
Follow
47
Followers
Почему при использовании GetRecords я получаю две одинаковые строки K?
Created 2021-10-07 22:01:05 Updated 2021-10-10 20:54:15
5
1101
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?
Comment
All comments (5)
不过确实有这个问题呢,我是这么解决的
let r = _C(this.exchange.GetRecords, PERIOD_M1 * period);
//Log("获取新K线,当前的完结K线:",$.GetLast(r,1),"上次的K线:",this.lastKTime);
let reAskCount = 0; //重新获取k线的次数,第一次重新获取不休眠,之后休眠避免获取次数太多导致断开链接
while($.GetLast(r,1).Time<=this.lastKTime){
//Log("相同K线,重新获取");
r = _C(this.exchange.GetRecords,PERIOD_M1 * period);
if(reAskCount>1)
Sleep(1000);
reAskCount++;
//Log("重新获取的K线:",$.GetLast(r,1));
}
5 years ago
- 1





