Support Board
Date/Time: Thu, 28 Nov 2024 01:17:04 +0000
Post From: Confused of difference between SCFloatArray and scFloatArrayRef
[2013-10-07 18:24:35] |
gabby alindogan - Posts: 49 |
Hello. I am a little confused about the use of scfloatarrayref vs. scFloatArray. I created identical studies below-the top one uses scfloatarrayref, the other just scfloatarray. They yield difference results. Can someone please explain the difference and when one should use 1 over the other? THANKS. SCSFExport scsf_Sigma3(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.AutoLoop=1; sc.GraphName = "SigmawArrayRef" ; sc.Subgraph[0].Name = "Spike3 "; sc.AutoLoop=1; sc.FreeDLL = 1; return; } SCFloatArrayRef Close1BB = sc.Subgraph[0].Arrays[0]; SCFloatArrayRef Close2BB = sc.Subgraph[0].Arrays[1]; SCFloatArrayRef Cl2ClLog = sc.Subgraph[0].Arrays[2]; SCFloatArrayRef Sigma = sc.Subgraph[0].Arrays[3]; SCFloatArrayRef DollarSigma = sc.Subgraph[0].Arrays[4]; SCFloatArrayRef Delta = sc.Subgraph[0].Arrays[5]; SCFloatArrayRef Spike1BB = sc.Subgraph[0].Arrays[6]; Close1BB[sc.Index] =sc.Close[sc.Index-1]; Close2BB[sc.Index] =sc.Close[sc.Index-2]; Delta[sc.Index] = Close1BB[sc.Index]-Close2BB[sc.Index]; Cl2ClLog[sc.Index] = log(Close1BB[sc.Index] / Close2BB[sc.Index]); sc.StdDeviation(Cl2ClLog,Sigma,480); DollarSigma[sc.Index] = Sigma[sc.Index] * Close1BB[sc.Index]; Spike1BB[sc.Index]=Delta[sc.Index] / DollarSigma[sc.Index]; sc.Subgraph[0][sc.Index] =Spike1BB[sc.Index]; return; } SCSFExport scsf_Sigma4(SCStudyInterfaceRef sc) { // Section 1 - Set the configuration variables if (sc.SetDefaults) { sc.AutoLoop=1; sc.GraphName = "Sigma4 " ; sc.Subgraph[0].Name = "Spike in Sigmas "; sc.AutoLoop=1; sc.FreeDLL = 1; return; } SCFloatArray Close1BB ; SCFloatArray Close2BB ; SCFloatArray Cl2ClLog ; SCFloatArray Sigma; SCFloatArray DollarSigma ; SCFloatArray Delta; SCFloatArray Spike1BB ; Close1BB[sc.Index] =sc.Close[sc.Index-1]; Close2BB[sc.Index] =sc.Close[sc.Index-2]; Delta[sc.Index] = Close1BB[sc.Index]-Close2BB[sc.Index]; Cl2ClLog[sc.Index] = log(Close1BB[sc.Index] / Close2BB[sc.Index]); sc.StdDeviation(Cl2ClLog,Sigma,480); DollarSigma[sc.Index] = Sigma[sc.Index] * Close1BB[sc.Index]; Spike1BB[sc.Index]=Delta[sc.Index] / DollarSigma[sc.Index]; sc.Subgraph[0][sc.Index] =Spike1BB[sc.Index]; return; } |