Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 22:43:37 +0000



Post From: Button menu toggle

[2021-01-25 03:01:34]
ertrader - Posts: 672
I'm trying to add a button to the menu which enables or disables (yes/no) a selection in a study. Does anyone know how to do this with ACSIL?

I've been able to get the following code to enable or disable a study, however, when I try to add a second button, the two buttons get linked/combined so they toggle back and forth rather than independently working. I used different variables for the second button but they were still combined when toggled.

This comes from the study: AutomatedTradeManagementBySubgraph.cpp

Does anyone know how to add a button for anything other than enabling/disabling a study?

The button on the far right (ES) of the first image works to enable or disable the ES study. I also want to have another button to enable/disable longs. The second image is where you add the button to the control menu.

This is all done through the customize control bar options.


if (sc.IsFullRecalculation)//Is full recalculation
{
  // set ACS Tool Control Bar tool tip
  sc.SetCustomStudyControlBarButtonHoverText(Input_ACSButtonNumber.GetInt(), "Trade Enable/Disable");

// set Custom Study Control Bar button text if the input to allow custom properties is not true. Otherwise, rely upon what the user sets.
  if (!Input_AllowCustomPropertiesForControlBarButton.GetYesNo())
  sc.SetCustomStudyControlBarButtonText(Input_ACSButtonNumber.GetInt(), "TCCI");
      
  sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber.GetInt(), Enabled.GetBoolean() );

}

// Wait for an event to enable study if not already enabled
if (sc.MenuEventID == Input_ACSButtonNumber.GetInt())
{
  const int ButtonState = (sc.PointerEventType == SC_ACS_BUTTON_ON) ? 1 : 0;
  Enabled.SetYesNo(ButtonState);
      
}

Date Time Of Last Edit: 2021-01-25 03:46:29
imageScreenshot from 2021-01-24 22-36-40.png / V - Attached On 2021-01-25 03:37:14 UTC - Size: 18.11 KB - 449 views
imageScreenshot from 2021-01-24 22-40-00.png / V - Attached On 2021-01-25 03:40:18 UTC - Size: 67.44 KB - 394 views