During the testing of the TA library indicators on the platform, Log showed the indicator values of the PERIOD
function main(){
while(true){
exchange.SetMarginLevel(10);
exchange.SetContractType("quarter");
var beginTime = new Date().getTime()
var records = exchange.GetRecords(PERIOD_M5)
var endTime = new Date().getTime()
LogStatus("GetRecords 接口延迟时间:", endTime - beginTime, "毫秒。")
Sleep(500)
}
}
The Little DreamIt is true that the exchange updates the K-line with a delay of 3 seconds or synthesizes the K-line itself using ticker data.
wcg123For example, records that require a 5-minute cycle from 0 to 0 to 0 to 0 would theoretically get the value of the previous 5-minute cycle at 0 to 0 to 0 to 0 seconds, but I would need to run the real disk for 3 to 4 seconds to see the update.
The Little DreamHowever, in the real disk, it is found that the value of the previous cycle is updated every 3-4 seconds after the time cycle.
nxtplayerBecause of the flute, I tried to change the sky too.
wcg123I noticed that Huobi's getrecords update was delayed by 5s.
nxtplayerThis is embarrassing.
wcg123It's like the OKEX platform updating the K-line meeting card in three seconds.
nxtplayerYou get a bar every 1 second, monitor the time of the bar, and if the time changes, there's a new bar, then compare it.