Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 02:40:27 +0000



Post From: Code optimization

[2021-09-13 00:09:01]
ertrader - Posts: 672
  if (sc.IsFullRecalculation)

  {

    // set ACS Tool Control Bar tool tip
    sc.SetCustomStudyControlBarButtonHoverText(Input_ACSButtonNumber.GetInt(), "Trade Enable/Disable");
    sc.SetCustomStudyControlBarButtonHoverText(Input_ACSButtonNumber1.GetInt(), "Long");
    sc.SetCustomStudyControlBarButtonHoverText(Input_ACSButtonNumber2.GetInt(), "Short");
    sc.SetCustomStudyControlBarButtonHoverText(Input_ACSButtonNumber3.GetInt(), "Send");     
    // 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(), "Trade");
    if (!Input_AllowCustomPropertiesForControlBarButton1.GetYesNo())
     sc.SetCustomStudyControlBarButtonText(Input_ACSButtonNumber1.GetInt(), "Long");
    if (!Input_AllowCustomPropertiesForControlBarButton2.GetYesNo())
     sc.SetCustomStudyControlBarButtonText(Input_ACSButtonNumber2.GetInt(), "Short");   
    if (!Input_AllowCustomPropertiesForControlBarButton3.GetYesNo())
     sc.SetCustomStudyControlBarButtonText(Input_ACSButtonNumber3.GetInt(), "Send");   
    // set buttons to disabled i.e. not pushed in state
    sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber.GetInt(), 0);
    sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber1.GetInt(), 0);
    sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber2.GetInt(), 0);     
    sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber3.GetInt(), 0);     
    // set button color to show enabled / disabled state
  }
    if (Enabled.GetYesNo())
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber.GetInt(), RGB(0, 128, 255));
    else
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber.GetInt(), COLOR_RED);
  
    if (Long.GetYesNo())
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber1.GetInt(), RGB(0, 128, 255));
    else
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber1.GetInt(), COLOR_RED);
  
    if (Short.GetYesNo())
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber2.GetInt(), RGB(0, 128, 255));
    else
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber2.GetInt(), COLOR_RED);   
  
    if (SendOrdersToService.GetYesNo())
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber3.GetInt(), RGB(0, 128, 255));
    else
     sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber3.GetInt(), COLOR_RED);