Login Page - Create Account

Support Board


Date/Time: Sat, 30 Nov 2024 00:31:17 +0000



[Programming Help] - How to simply get a value from the VZO once in a while for my one-chart study

View Count: 463

[2022-12-28 19:38:38]
chrisflow - Posts: 3
Is there a simple way to get the Volume Zone Oscillator value and put it into a float variable? This is what I want: "x = current VZO value." I also tried putting the VZO into a subgraph called "Subgraph_VZO" but can't get it to work at all, as you can see below, all failures.

Or must I use "sc.GetStudyArrayFromChart()" because I can't get that to work either copying from Studies 1-8.cpp.

I've tried all these and none work. They are commented out after they failed to compile and I moved on to the next try..

      //Subgraph_VZO[sc.Index] = scsf_VolumeZoneOscillator[sc.Index].Subgraph_VZO[sc.Index];
      //sc.BaseDataIn[SC_LAST], Subgraph_VZO[sc.Index],
      //scsf_VolumeZoneOscillator(14, 60, 40, 15, -5, -40, -60);
      // scsf_VolumeZoneOscillator(Subgraph_VZO[sc.Index]).Subgraph_VZO;
      // Subgraph_VZO[sc.Index] = scsf_VolumeZoneOscillator[sc.BaseData[SC_LAST]].Subgraph_VZO[sc.Index];
      // Subgraph_ozVZO[sc.Index] = scsf_VolumeZoneOscillator[sc.Index].Subgraph[7);
      // Subgraph_ozVZO[sc.Index] = sc.VolumeZoneOscillator[sc.Index].Subgraph[7);
      //Subgraph_ozVZO[sc.Index] = scsf.VolumeZoneOscillator[sc.BaseDataIn[sc.Index]].Subgraph[7)];
      // sc_VolumeZoneOscillator[sc.BaseDataIn[SC_LAST], Subgraph_ozVZO[sc.Index]];
      // sc.VolumeZoneOscillator[sc.BaseDataIn[SC_LAST], Subgraph_ozVZO[sc.Index]];
      // scsf_VolumeZoneOscillator[sc.BaseDataIn[SC_LAST], Subgraph_ozVZO[sc.Index]];
      // scsf.VolumeZoneOscillator[sc.BaseDataIn[SC_LAST], Subgraph_ozVZO[sc.Index]];
      // sc.VolumeZoneOscillator[sc.BaseDataIn[SC_LAST], Subgraph_ozVZO[sc.Index]];
      //scsf_VolumeZoneOscillator[sc.BaseDataIn[sc.Index], Subgraph_ozVZO[sc.Index]];
      // scsf_VolumeZoneOscillator[sc.BaseDataIn[sc.Index], Subgraph_ozVZO[sc.Index], 14, 60, 40, 15, -5, -40, -60];
      // scsf_VolumeZoneOscillator[sc.BaseDataIn[sc.Index], Subgraph_ozVZO[sc.Index], 14, 60, 40, 15, -5, -40, -60];
      //scsf_VolumeZoneOscillator[sc.BaseDataIn[sc.Index], Subgraph_ozVZO, 14, 60, 40, 15, -5, -40, -60];
      // scsf_VolumeZoneOscillator[sc.BaseDataIn[sc.Index], Subgraph_ozVZO, 14];  
      // scsf_VolumeZoneOscillator[sc.BaseDataIn, Subgraph_ozVZO, 14];  
      //scsf_VolumeZoneOscillator(sc.BaseDataIn, Subgraph_ozVZO, 14);  
      // scsf_VolumeZoneOscillator(sc.BaseDataIn[Input_Data.GetInputDataIndex()], Subgraph_ozVZO, 14);
      //scsf_VolumeZoneOscillator(sc.BaseDataIn[Input_Data.SC_LAST], Subgraph_ozVZO, 14);

Thanks!
Date Time Of Last Edit: 2022-12-28 19:39:16
[2022-12-29 03:04:49]
ForgivingComputers.com - Posts: 960
I suggest the use of sc.GetStudyArrayUsingID().

Assuming Autoloop = true, Vol Zone Oscillator study is ID1, and the VZO SG = 8:

int ID = 1;
int SG = 7; //This is zero-based so this is SG8 on the chart

SCFloatArray VZOStudy;
sc.GetStudyArrayUsingID(ID, SG, VZOStudy);

float x = VZOStudy[sc.Index];


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

Login

Login Page - Create Account