Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 05:18:15 +0000



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

[2016-08-16 21:03:36]
User203925 - Posts: 40
Use sc.GetStudyArrayFromChartUsingID to pull any indicator / Array from one chart to another chart. Now when the charts are the same tick size the indicators are equal. But if you reduce the tick size of one of the charts so the size of the charts are not equal, the indicator/array on the reduced size does not calculate up to BaseData[SC_LAST][sc.Index]. Here is the code below to import the indicator/array. See for yourself.



#include "sierrachart.h"

SCSFExport scsf_Master_Storage(SCStudyGraphRef sc)
{
SCSubgraphRef PPO2 = sc.Subgraph[1];
float PPOFloat1 = sc.GetPersistentFloat(1);

if (sc.SetDefaults)
  {
    //Long descriptive name.
    sc.GraphName = "Master Storage";

    sc.StudyVersion = 1.0;

    // During development set this flag to 1, so the DLL can be rebuilt without restarting Sierra Chart. When development is completed, set it to 0 to improve performance.
    sc.FreeDLL = 1;

    //Data for the "Display Study Documentation" button
    sc.StudyDescription = "Storing PPO Values per tick to file";
    //needed for extra tick data.
    sc.MaintainAdditionalChartDataArrays = 1;

    //sc.GraphRegion = 1; //in this case, not main price graph

    sc.AutoLoop = 1; //Auto looping is enabled.

    //Keep alerts from going crazy.
    sc.AlertOnlyOncePerBar = true;

    //Initial setting for decimal places. Will be changed on first run.
    sc.ValueFormat = 0;

    PPO2.Name = "Percentage Price Oscillator";
    PPO2.DrawStyle = DRAWSTYLE_LINE;
    PPO2.PrimaryColor = COLOR_GREEN;
    PPO2.SecondaryColor = COLOR_RED;
    PPO2.AutoColoring = AUTOCOLOR_SLOPE;


    return;
  }


SCFloatArray Chart256000;
sc.GetStudyArrayFromChartUsingID(4, 1, 8, Chart256000);

PPO2[sc.Index] = Chart256000[sc.Index];
Chart256000[sc.Index] = PPO2[sc.Index];

}