Login Page - Create Account

Support Board


Date/Time: Sat, 11 May 2024 05:12:34 +0000



Post From: ACSIL sc.TickSize Returns 0*

[2024-03-29 03:24:32]
Gradient - Posts: 41
I believe I found the issue.

I created a simple study just to output the sc.TickSize value.(see below)

#include "sierrachart.h"

using namespace std;

SCDLLName("ShowTickSize")


void GetTickSize(SCStudyInterfaceRef sc){
  
  //store tick size in subgraph
  
  sc.Subgraph[0][sc.Index]=sc.TickSize;
}




SCSFExport scsf_c1( SCStudyInterfaceRef sc)
{
  //Inputs
  

  if (sc.SetDefaults){
  //set graph defaults
  
  sc.GraphName= "ShowTickSize";
  
  
  //Reference Study
  sc.Subgraph[0].Name="Tick Size";
  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;
  
  
  
  }
  //display entries and exits on main graph instead of subgraph
  sc.GraphRegion=1;
  
  GetTickSize(sc);
  

  return;
};


When running this study as in my primary study, I noticed that sc.TickSize is 0 sometimes and sometimes it returns the actual ticksize.

I checked the message logs and received an error stating that there was a CPU exception and the study made the platform unstable until removing it and restarting the platform.

I believe this explains why sc.TickSize was 0 in the prior posts.

I've attached examples of running this simple study via a scan which shows sometimes the return value is correct and sometimes it is 0.

Ideally, removing the study and restarting the platform should correct this per the message logs.
imageTickSize Exception.png / V - Attached On 2024-03-29 03:20:35 UTC - Size: 20.28 KB - 26 views
imageTickSize Working.png / V - Attached On 2024-03-29 03:22:29 UTC - Size: 63.34 KB - 26 views
imageTickSize Not Working.png / V - Attached On 2024-03-29 03:22:36 UTC - Size: 65.52 KB - 25 views