Login Page - Create Account

Support Board


Date/Time: Wed, 15 May 2024 17:24:07 +0000



Post From: ReadIntradayFileRecordAtIndex returns error when loading historical data on replay

[2018-08-02 16:44:06]
onnb - Posts: 661
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);
}