Login Page - Create Account

Support Board


Date/Time: Sat, 11 May 2024 23:09:03 +0000



Post From: ACSIL sc.TickSize Returns 0*

[2024-03-21 19:09:39]
Gradient - Posts: 41
Okay I understand the rationale for the string formatting comment. I did however, implement the string conversion per the documentation as I've done several times before with no issues.

To further investigate the issue I structured an experiment.

My goal is to read in data from a study, compare it to some level, and divide by the sc.TickSize.

I'm dividing by the sc.TickSize to normalize the values as this is being run via "Start Scan" from the Chart Menu.


Experiment:

I computed a metric (i.e. simple deviation of current High from value of study).

I computed this metric 1) using the sc.TickSize and 2) without using the sc.TickSize

I then stored the values of both in a Subgraphs.

I also stored the High used to compute the metric in a subgraph as well as the reference study output and the sc.TickSize.

See Below:

//reference from study stored in sc.Subgraph[0]
//No Tick Size
sc.Subgraph[5][sc.Index]=abs((sc.Subgraph[0][sc.Index-1]-sc.High[sc.Index-1]));
  
//With Tick Size
sc.Subgraph[6][sc.Index]=abs((sc.Subgraph[0][sc.Index-1]-sc.High[sc.Index-1]))/sc.TickSize;
  
//High
sc.Subgraph[7][sc.Index]=sc.High[sc.Index];
    
//Store sc.TickSize
sc.Subgraph[8][sc.Index]=sc.TickSize


//Graphs

  //Reference Study
  sc.Subgraph[0].Name="Reference Study";
  sc.Subgraph[0].DrawStyle=DRAWSTYLE_LINE;
  sc.Subgraph[0].PrimaryColor = RGB(8, 25, 128);
  sc.Subgraph[0].LineWidth = 4;
  sc.Subgraph[0].DrawZeros = false;
  sc.Subgraph[0].DisplayNameValueInDataLine=true;
  
  
  //Current High
  sc.Subgraph[7].Name="Current Chart Value";
  sc.Subgraph[7].DrawStyle=DRAWSTYLE_LINE;
  sc.Subgraph[7].PrimaryColor = RGB(8, 25, 128);
  sc.Subgraph[7].LineWidth = 4;
  sc.Subgraph[7].DrawZeros = false;
  sc.Subgraph[7].DisplayNameValueInDataLine=true;
  
  
  //No Tick Size
  sc.Subgraph[5].Name="No Tick Size";
  sc.Subgraph[5].DrawStyle=DRAWSTYLE_LINE;
  sc.Subgraph[5].PrimaryColor = RGB(128, 25, 128);
  sc.Subgraph[5].LineWidth = 4;
  sc.Subgraph[5].DrawZeros = false;
  sc.Subgraph[5].DisplayNameValueInDataLine=true;
  
  //With Tick Size
  sc.Subgraph[6].Name="With Tick Size";
  sc.Subgraph[6].DrawStyle=DRAWSTYLE_LINE;
  sc.Subgraph[6].PrimaryColor =RGB(18, 255, 128);
  sc.Subgraph[6].LineWidth = 4;
  sc.Subgraph[6].DrawZeros = false;
  sc.Subgraph[6].DisplayNameValueInDataLine=true;
  
  
  //With Tick Size
  sc.Subgraph[8].Name="Actual Tick Size Value";
  sc.Subgraph[8].DrawStyle=DRAWSTYLE_LINE;
  sc.Subgraph[8].PrimaryColor =RGB(18, 55, 18);
  sc.Subgraph[8].LineWidth = 4;
  sc.Subgraph[8].DrawZeros = false;
  sc.Subgraph[8].DisplayNameValueInDataLine=true;



I've attached the screenshot of the output from each of the subgraphs.

TickSize is still 0 when simply storing the value to subgraph.

Also, the sc.High[sc.Index] of the current chart is 0 as well as each of the subgraph outputs.

How do you advise to correct this?
imageTick Size Error 2.png / V - Attached On 2024-03-21 19:08:31 UTC - Size: 19.22 KB - 39 views