Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 14:00:39 +0000



ACS Button To Control Spreadsheet Subgraph

View Count: 339

[2023-04-27 18:12:15]
User483852 - Posts: 16
Hello,

I am trying to have an ACS button to control a subgraph of a spreadsheet trading system. The subgraph has just the formula : ID0.SG1>ID0.SG4.

Can you please point me in the right direction.

Thanks and Regards,
[2023-04-27 21:05:40]
John - SC Support - Posts: 36350
We are not sure you understand the ACS buttons. These are to be used by a custom study. Refer to the following:
Advanced Custom Study Interaction With Menus, Control Bar Buttons, Pointer Events: Advanced Custom Study Buttons and Pointer Events

What are you wanting to do with a control bar button with regards to a subgraph?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-04-29 12:44:08]
User483852 - Posts: 16
Never mind, I got the solution using the code below:

SCSFExport scsf_ACSButtonOutputOnEnable(SCStudyGraphRef sc)

{

sc.GraphName = "ACS Button Output On Enable";
sc.StudyDescription = "Sends an output when the ACS button is enabled.";
    
    int value = sc.GetCustomStudyControlBarButtonEnableState(1); //Get the status of the control bar button

    sc.Subgraph[0].Name="Button Number";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[0].LineStyle = LINESTYLE_DOT;
sc.Subgraph[0].PrimaryColor = RGB(0,255,0);
    
    sc.Subgraph[1].Name="Button Status";
sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[1].LineStyle = LINESTYLE_DOT;
sc.Subgraph[1].PrimaryColor = RGB(255, 0, 0);
    sc.Subgraph[1].DisplayNameValueInDataLine=1;
    
   sc.Input[0].Name = "ACS Control Bar Button Number";
sc.Input[0].SetInt(1);
    sc.Input[1].Name = "Button Status";
sc.Input[1].SetInt(value);

    sc.FreeDLL=0; // 1 for dev else 0
  
    int barstatus = sc.Input[1].GetInt();

    for (int i = sc.UpdateStartIndex; i < sc.ArraySize; i++)
{
sc.Subgraph[1] = barstatus;
  }
  return;
};

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

Login

Login Page - Create Account