Login Page - Create Account

Support Board


Date/Time: Sat, 22 Feb 2025 17:37:24 +0000



[Programming Help] - Market Depth Date Time Questions

View Count: 1019

[2021-01-31 09:39:45]
User210074 - Posts: 63
Hello,
1) In the file 'ES.20210300.CME_Eq.2021-01-29.depth' do you record the date time ?
2) Is there a function to access the date time of items saved in the file (As in "c_SCTimeAndSales") ?
[2021-01-31 10:52:39]
User907968 - Posts: 832
1) Yes the depth records have a date time variable.

2) No, for information you could look at - ACSIL Interface Members - Historical Market Depth Data (c_ACSILDepthBars) for access to depth data, however that doesn't expose the depth data directly.

If you want to work with the depth data without abstraction, then you can read the depth data file directly. The file structure is shown here - https://www.sierrachart.com/index.php?page=doc/MarketDepthDataFileFormat.html.
[2021-01-31 17:50:16]
User210074 - Posts: 63
Thx,
I do this.

The problem is that the 's_MarketDepthEntry' function does not contain a date time.


#include "sierrachart.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <utility>

using std::ifstream;
using std::ofstream;
using std::ios_base;
using std::string;
using std::to_string;
using std::stoi;
using std::vector;
using std::pair;
using std::make_pair;

SCDLLName("Market_Depth_test_v1.cpp");
SCSFExport scsf_Market_Depth_test_v1(SCStudyGraphRef sc) {

  if(sc.SetDefaults){
     sc.GraphName = "Market_Depth_v1";
     sc.FreeDLL = 1;
     sc.AutoLoop = 0;
     sc.GraphRegion = 0;
     sc.UpdateAlways = 1;
     sc.UsesMarketDepthData = 1;

     return;

  }


const int MaximumMarketDepthLevels = sc.GetMaximumMarketDepthLevels();

int temp = 100;/*temporarily for ES*/
int LevelSize = 0;

if(sc.GetAskMarketDepthNumberOfLevels() > sc.GetBidMarketDepthNumberOfLevels()){
   int LevelSize = sc.GetAskMarketDepthNumberOfLevels();
}
else{
   int LevelSize = sc.GetBidMarketDepthNumberOfLevels();
}

if(sc.ArraySize - MaximumMarketDepthLevels < 0){
   return;
}

for(int Level = 0; Level < LevelSize; Level++){

   s_MarketDepthEntry DepthEntry;
  
   sc.GetBidMarketDepthEntryAtLevel(DepthEntry, Level);
int Bqt = (int)DepthEntry.Quantity;
int Bpr = (int)(DepthEntry.Price*temp);

   sc.GetAskMarketDepthEntryAtLevel(DepthEntry, Level);
int Aqt = (int)DepthEntry.Quantity;
int Apr = (int)(DepthEntry.Price*temp);

sc.AddMessageToLog((to_string(Bpr)+" : "+to_string(Bqt)+" <-> "+to_string(Aqt)+" : "+to_string(Apr)).c_str(),1);

}

}

Date Time Of Last Edit: 2021-01-31 17:51:43
[2021-01-31 19:03:56]
User907968 - Posts: 832
So you would need to read from the .depth file directly as the 's_MarketDepthFileRecord' certainly has a date/time member.
[2021-02-01 11:37:48]
User210074 - Posts: 63
Thank you for your answer !

Now,I looked in the "ACSILDepthBars.h".

"c_ACSILDepthBars" does not contain datetime functions.

Certainly the function "s_MarketDepthFileRecord" contains datetime functions, but i'don't find it in "ACSILDepthBars.h" or "IntradayRecord.h".

I did not find it in all the headers of SIERRACHART !

Should we create the header and insert this Market Depth Data File Format.?
[2021-02-01 13:38:01]
User907968 - Posts: 832
Yes, that would be a good place to start.

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

Login

Login Page - Create Account