Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 06:56:00 +0000



Post From: Saving Tick by Tick Data from a 256,000 Tick Chart

[2016-08-18 00:21:30]
User203925 - Posts: 40
Here is one way to save tick by tick fluctuations between an indicator and the price when the indicator is on different size charts:

Debugging:
1) In the properties settings Go to "C/C++" -> "Code Generation" -> and set "Runtime Library" to Inherit from Parent or leave blank

The projects.
1) Save your indicator on your larger tick chart to a float
2) Pull the float into another study on the 1 tick chart with sc.GetStudyPersistentFloatFromChart(). See code Below


if (sc.Index >= 0) {

Indicator = sc.GetStudyPersistentFloatFromChart(1, 1, 0);
Subgraph[sc.Index] = Indicator;
    

ofstream outFile;
outFile.open("ProjectDataV8.txt");

for (int i = 0; i <= sc.BaseDataIn[SC_LAST].GetArraySize(); i++)
{
PriceValue = sc.BaseDataIn[SC_LAST][sc.Index - i];
Indicator = Subgraph[sc.Index - i];
      
outFile << Value << "," << Free << endl;
}
outFile.close();
return;

Loading the studies.
1) Start your backtest and pause it right away.
2) After you have paused your backtest, load your studies starting with the study on the 1 tick chart. Next, load your study that contains your indicator on the larger chart.
3) Push "Play" on the back test and it will start to write the tick by tick data to file.