Support Board
Date/Time: Tue, 21 Jan 2025 07:42:32 +0000
Post From: ReadIntradayFileRecordAtIndex returns error when loading historical data on replay
[2018-08-02 16:44:06] |
onnb - Posts: 662 |
See code snippet below When I load the chart (without replay) it works ok. ReadIntradayFileRecordAtIndex returns 1 and rec is fine. When I start the replay, study process historical data before replaying the "live" bar. ReadIntradayFileRecordAtIndex returns 0 and rec is 0. Once the replay starts and study is processing live bar, it works fine. So issue is just with the historical data in replay. SCSFExport scsf_test_ReadIntradayFileRecordAtIndex(SCStudyInterfaceRef sc)
{ if (sc.SetDefaults) { sc.GraphName = "ReadIntradayFileRecordAtIndex Test"; sc.StudyDescription = ""; sc.AutoLoop = 1; sc.GraphRegion = 0; sc.FreeDLL = 1; return; } s_IntradayRecord rec = { 0 }; int res = sc.ReadIntradayFileRecordAtIndex(sc.Index, rec, IFLA_LOCK_READ_RELEASE); sc.AddMessageToLog(SCString().Format("%i: (%i) Open: %s", sc.Index, res, sc.FormatGraphValue(rec.Close, sc.BaseGraphValueFormat)), 0); } |