Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 12:49:39 +0000



Post From: scid real time file update question

[2017-10-28 02:46:20]
Sierra Chart Engineering - Posts: 104368
Use version 1630. Below is example code:
SCSFExport scsf_ReadFromUnderlyingIntradayFileExample(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "Read from Underlying Intraday File Example";


    sc.AutoLoop = 0;

    sc.FreeDLL = 0;

    return;
  }

  if (sc.LastCallToFunction)
    return;

  s_IntradayRecord IntradayRecord;

  for (int FileIndex = sc.FileRecordIndexOfLastDataRecordInChart; FileIndex >= sc.FileRecordIndexOfLastDataRecordInChart - 10; FileIndex--)
  {
    bool FirstIteration = FileIndex == sc.FileRecordIndexOfLastDataRecordInChart;
    bool LastIteration = FileIndex <= sc.FileRecordIndexOfLastDataRecordInChart - 10;
    IntradayFileLockActionEnum IntradayFileLockAction = IFLA_NO_CHANGE;

    if (FirstIteration && LastIteration)
      IntradayFileLockAction = IFLA_LOCK_READ_RELEASE;
     else if (FirstIteration)
      IntradayFileLockAction = IFLA_LOCK_READ_HOLD;
    else if (LastIteration)
      IntradayFileLockAction = IFLA_RELEASE_AFTER_READ;

    sc.ReadIntradayFileRecordAtIndex(FileIndex, IntradayRecord, IntradayFileLockAction);

    SCDateTimeMS TradeTimestampInChartTimeZone = IntradayRecord.DateTime + sc.TimeScaleAdjustment;

  }

  // Could also use this line of code to release the lock if not sure when will be complete with reading and want to do it as a separate operation. An index of -1 signifies not actually to perform a read.
  ///sc.ReadIntradayFileRecordAtIndex( -1, IntradayRecord, IFLA_RELEASE_AFTER_READ);
    

}

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing