Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 15:26:28 +0000



Post From: Getting error messages all over the place.

[2017-06-24 22:36:54]
Ernest - Posts: 10
Thank you, The actuall problem was that I was not being very explicit, I thought that Sierra will assume that when I was writing Tool.BeginDateTime = sc.BaseDateTimeIn[], I had to especify the index Tool.BeginDateTime = sc.BaseDateTimeIn[sc.Index]



Now I get my rectangle but is not looping thru the chart, actually it is not even starting where I am telling to start



// The top of every source code file must include this line

#include "sierrachart.h"

SCDLLName("highvolumearea") // Name of the Study


SCSFExport scsf_highvolumearea(SCStudyInterfaceRef sc)
{
  // Section 1 - Set the configuration variables and defaults
  if (sc.SetDefaults)
  {
    sc.GraphName = "highvolumearea";
  
  sc.StudyDescription = "This indicator Will draw rectangles on High Volume Areas"; // Brief Study Description
    
    sc.GraphRegion = 0; // This sets the main area to the main graph
    
    sc.FreeDLL = 1; // 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.AutoLoop = 1; //Automatic looping is enable.

    return;
  }
   int LookBackBars; //Variable that holds Bars to look back
sc.Input[0].Name = "LookBackBars"; //Set the input name
   sc.Input[0].SetIntLimits(1, 300); //Set limits to this Input
   //sc.Input[0].SetInt(50); //Set initial Value
   LookBackBars = sc.Input[0].GetInt(); //Get the value if user change it
  
   sc.DataStartIndex = (LookBackBars + 4); //THIS IS WHERE I AM SPECIFING THE START INDEX


The code is actually painting a rectangle but only on the first bar which is not even close to the 50 bars i set as an starting point. Why is not picking the DataStartIndex??

Also, the if condition is not working at all, do you see anything wrong? I know it is very basic but I have to start for the easy ones.


if (sc.Close[sc.Index] > sc.Open[sc.Index])
  {
    if (sc.High[sc.Index-1] < sc.Close[sc.Index])
    {



Just to be sure, when I write sc.High[sc.Index-1], I am refering to the previous bar high, right??? My condition is that



Thanks
Date Time Of Last Edit: 2017-06-24 22:42:18