Login Page - Create Account

Support Board


Date/Time: Tue, 23 Apr 2024 08:54:31 +0000



[Programming Help] - Reading each trade price

View Count: 577

[2018-10-04 19:54:32]
User585949 - Posts: 2
Hello

I'm writing my own study in C++ and I need to analyse most detail price flow, so I need as short timeframe as possible. For now I'm using my study on 1 second chart, but sometimes there is a bar where it's close is between high and low. In this case I don't know if price was first on high or on low of this bar.
How can I get every trade price in my study ?
If Sierrachart study is not able to deliver to my study every trade price is there any other way to get this detail data ? Maybe you have any other data interface I can use in my trading program ?

Best regards
Tomasz Wilczynski
[2018-10-04 20:58:31]
ganz - Posts: 1048
User585949

Intraday Data File Format
[2018-10-05 00:20:30]
Sierra Chart Engineering - Posts: 104368
There is a newer way to do this in Sierra Chart and that is to use this function:
sc.ReadIntradayFileRecordForBarIndexAndSubIndex()
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
[2018-10-07 13:37:27]
User585949 - Posts: 2
I've added to my study function to read bar details ( TimeFrame = 1 sec). This function is called on bars where high > close and low < close. But starting Replay Chart for testing on every examining bar IntradayRecord is filled only once when SubIndex = 0. On next loop passing, when SubIndex = 1 ReadIntradayFileRecordForBarIndexAndSubIndex always returns 0 ( no success).
Below is my code ( sc.MaintainAdditionalChartDataArrays = 1 in SetDefauls is added in main study function).
Am I doing something wrong ?

static void ReadBarDetails( SCStudyInterfaceRef sc, int Index )
{
  int ReadSuccess = true;
  bool FirstIteration = true;
  uint32_t TotalVolume = 0;
  int SubIndex = 0;//Start at first record within bar
  s_IntradayRecord IntradayRecord;
  while ( ReadSuccess )
  {
    IntradayFileLockActionEnum IntradayFileLockAction = IFLA_NO_CHANGE;
    if ( FirstIteration )
    {
      IntradayFileLockAction = IFLA_LOCK_READ_HOLD;
      FirstIteration = false;
    }
    ReadSuccess = sc.ReadIntradayFileRecordForBarIndexAndSubIndex( Index, SubIndex, IntradayRecord, IntradayFileLockAction );
    if ( ReadSuccess )
    {
      TotalVolume += IntradayRecord.TotalVolume;
      ++SubIndex;
    }
  }
  sc.ReadIntradayFileRecordForBarIndexAndSubIndex( -1, -1, IntradayRecord, IFLA_RELEASE_AFTER_READ );

  SCString TotalVolumeString;
  TotalVolumeString.Format( "Total volume: %u", TotalVolume );

  sc.AddMessageToLog( TotalVolumeString, 0 );
}
Date Time Of Last Edit: 2018-10-08 08:50:45

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account