Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 02:10:47 +0000



[Programming Help] - Using ACS Control Bar Buttons with sc.AutoLoop=1

View Count: 155

[2024-09-14 07:04:46]
Alexander - Posts: 15
In the working example for the ACS Control Bar Buttons function, in the /ACS_Source/studies.cpp file, the Autolooping is set to OFF.

Is it possible to get a simple working example of using the ACS Control Bar Buttons function when Autolooping mode is enabled?

For example, this code doesn't work for me (pressing the button only affects the last bar):

////////////////////////////////////
if (sc.SetDefaults)
  {
  sc. AutoLoop = 1;   
  sc.ReceivePointerEvents = ACS_RECEIVE_POINTER_EVENTS_ALWAYS;
  return;  
  }
  
if (sc.MenuEventID >= ACS_BUTTON_1 && sc.MenuEventID <= ACS_BUTTON_150)
{
sc.SetCustomStudyControlBarButtonEnable(sc.PriorSelectedCustomStudyControlBarButtonNumber, 0);
}

int Lenght = 5;

sc.MenuEventID = ACS_BUTTON_1;
if(sc.PointerEventType == SC_ACS_BUTTON_ON) Lenght = 20;
if(sc.PointerEventType == SC_ACS_BUTTON_OFF) Lenght = 50;

sc.MovingAverage(sc.BaseDataIn[SC_LAST], sc.Subgraph[0], MOVAVGTYPE_SIMPLE, Lenght);
/////////////////////////////////////

Thank you in advance
Date Time Of Last Edit: 2024-09-14 08:00:34

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

Login

Login Page - Create Account