Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 16:00:33 +0000



Line Study Source code

View Count: 186

[2024-10-06 16:34:40]
Ticks - Posts: 183
I have been trying to find the Source Code for the Line study.
A picture of the line study settings form is attached.

I want to add the ability to draw a line at the bar Low price at a specific time.
Date Time Of Last Edit: 2024-10-06 16:49:54
imageLine Study.PNG / V - Attached On 2024-10-06 16:33:41 UTC - Size: 27.88 KB - 32 views
[2024-10-06 19:56:38]
gcUserStudies - Posts: 106
Using the study name you posted... You can search each Studiesx.cpp file in the ACS_Source directory. Example, I searched for scsf_Line. I'm showing it's in Studies7.cpp


/*==========================================================================*/
SCSFExport scsf_Line(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Subgraph_Line = sc.Subgraph[0];
  SCInputRef Input_Value = sc.Input[3];
  SCInputRef Input_NumberOfDaysToCalculate = sc.Input[0];

  if (sc.SetDefaults)
  {
    sc.GraphName = "Line";

    sc.GraphRegion = 1;
    sc.ValueFormat = 2;
    sc.AutoLoop = 1;

    Subgraph_Line.Name = "Line";
    Subgraph_Line.DrawStyle = DRAWSTYLE_LINE;
    Subgraph_Line.PrimaryColor = RGB(0,255,0);
    Subgraph_Line.DrawZeros = 1;

    Input_Value.Name = "Value";
    Input_Value.SetFloat(1.0f);

    Input_NumberOfDaysToCalculate.Name = "Number of Days to Calculate";
    Input_NumberOfDaysToCalculate.SetInt(0);

    sc.DataStartIndex = 0;

    return;
  }

  if(Input_NumberOfDaysToCalculate.GetInt() > 0)
  {
    Subgraph_Line.DrawZeros = 0;

    const SCDateTime TradingDayDateForLastBar = sc.GetTradingDayDate(sc.BaseDateTimeIn[sc.ArraySize - 1]);

    const SCDateTime TradingDayDateForBar = sc.GetTradingDayDate(sc.BaseDateTimeIn[sc.Index]);

    if ((TradingDayDateForLastBar.GetDate() - TradingDayDateForBar.GetDate() + 1)
  > Input_NumberOfDaysToCalculate.GetInt())
    {
      return;
    }
  }

  Subgraph_Line[sc.Index] = Input_Value.GetFloat();
}

[2024-10-06 20:39:09]
Ticks - Posts: 183
Thanks.
I was searching the ACS_Source folder for the study name "Line" to match the whole word only. Using Notepad++.
[2024-10-07 01:03:11]
Ticks - Posts: 183
The High/Low for Time Period - Extended study gives me what I need.
I set the start time and end time the same.
Set the input data high and input data low the same.
I hid the low subgraph.
That works perfectly.

But I can't get the stair step line to extend into the next day and beyond.
Any thoughts on that from anyone?
I want to be able to see the previous price lines extended to the right edge of my chart going back days and even months.

Screenshot attached
Date Time Of Last Edit: 2024-10-07 01:04:12
imageLine Study2.PNG / V - Attached On 2024-10-07 01:02:53 UTC - Size: 78.15 KB - 18 views
[2024-10-09 09:43:11]
Ticks - Posts: 183
Does anyone have any suggestions on how to get the High/Low for Time Period—Extended study to extend previous price lines to the right edge of my chart?

Sierra Support can this be done with this study?
[2024-10-09 09:54:45]
User431178 - Posts: 541

Does anyone have any suggestions on how to get the High/Low for Time Period—Extended study to extend previous price lines to the right edge of my chart?

No, you would need to modify it to do that.

Any of the following could work:
1. Include subgraph pairs (hi/lo) for D-1, D-2 etc (up to D-29), so 30 days of hi/lo.
2. Include an option to set for D-n, then add multiple copies of the study for each D-1, D-2 etc.
3. Use chart drawings to display the hi/lo for each period.

Sierra Support can this be done with this study?
Not Sierra support, but no, you only have two subgraphs, high and low, and it does not allow you to set for n-periods back.
[2024-10-09 16:21:46]
John - SC Support - Posts: 36247
Refer to the following for how to do this:
Color Bar Based on Alert Condition: Creating Extension Lines for Another Study
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-10-10 09:30:14]
Ticks - Posts: 183
Thanks, John. That is what I was looking for.
Picture attached.
Date Time Of Last Edit: 2024-10-10 09:44:30
imageLine Study4.PNG / V - Attached On 2024-10-10 09:44:13 UTC - Size: 50.26 KB - 21 views

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

Login

Login Page - Create Account