Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 22:16:15 +0000



Post From: Button menu toggle

[2021-01-25 03:08:27]
ertrader - Posts: 672
This code compiles but does NOT work as intended for the second button...the buttons toggle back and forth rather than work independently. It is an example of my thinking how this may have worked. In this case, I am attempting to create 2 buttons: One to enable/disable the study, the second to enable/disable to go long. Once I get this working, I will also add another button for shorts.

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

// 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");
      
if (!Input_AllowCustomPropertiesForControlBarButton1.GetYesNo())      
sc.SetCustomStudyControlBarButtonText(Input_ACSButtonNumber1.GetInt(), "Long");      

sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber.GetInt(), Enabled.GetBoolean() );
sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber1.GetInt(), Long.GetBoolean() );      

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

Date Time Of Last Edit: 2021-01-25 03:51:12