Login Page - Create Account

Support Board


Date/Time: Mon, 16 Sep 2024 19:47:48 +0000



Post From: Buttons for the Spreadsheet System for Trading Buy Exit Sell Exit formulas

[2024-07-18 01:00:11]
ForgivingComputers.com - Posts: 929
This code demonstrates how to read the value of another study. You can use this to set and control the stop.


#include "sierrachart.h"
SCDLLName("Demo Get SG from Other Study")

SCSFExport scsf_TemplateFunction(SCStudyInterfaceRef sc)
{
  SCInputRef OtherStudyRef = sc.Input[0];

  SCSubgraphRef SG_Subgraph = sc.Subgraph[0];

  if (sc.SetDefaults)
  {
    sc.AutoLoop = 1;
    OtherStudyRef.Name = "Study ID/SG";
    OtherStudyRef.SetStudySubgraphValues(32, 0);   //ID32.SG1

    SG_Subgraph.Name = "Subgraph";

  }

  SCFloatArray OtherStudy;

  sc.GetStudyArrayUsingID(OtherStudyRef.GetStudyID(), OtherStudyRef.GetSubgraphIndex(), OtherStudy);

  // Result
  SG_Subgraph[sc.Index] = OtherStudy[sc.Index];



  
}

Date Time Of Last Edit: 2024-07-18 01:01:49
attachmentTest_OtherStudy.cpp - Attached On 2024-07-18 00:59:27 UTC - Size: 618 B - 84 views