Login Page - Create Account

Support Board


Date/Time: Wed, 26 Feb 2025 16:02:28 +0000



Illogical ACS study button - forced choice

View Count: 804

[2021-05-15 23:08:00]
User968625 - Posts: 260
Hello,

There is something illogical about the ACS study buttons when it comes to trying to set up an automated trading system.

The “Trade Management by Study” requires an ACS button, you can’t leave it out (in order for it to work you have to select the button on). However, to engage a “Trading System based on alert condition” you need an ACS button”. The problem is that you can only have ONE ACS button active at a time.

How can that work? Can you allow the “Trade Management by the study” to have an option to be “ON” all the time without a button?. If you want to automate a trade, it is only logical to automate the stop. You can’t now have these two studies working together.

Is there something missing?

Please, I need help with this one

Thanks
Date Time Of Last Edit: 2021-05-15 23:11:38
[2021-05-16 05:51:55]
Sierra Chart Engineering - Posts: 104368
We will look into supporting multiple advanced custom study control bar buttons to be simultaneously active.

Just give us a few days to get this implemented. It will create more flexibility which we see is very important, but it is going to require some custom studies to change that rely on how the Custom Study Control Bar buttons currently work.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2021-05-16 06:29:04
[2021-05-17 01:53:08]
ertrader - Posts: 681
SC support, when you make the changes you are proposing, can you please provide update examples/guidance and the SC version needed and how to change current code? It took lots of trial and error to get the below ACS Control bar code working (it is reliable but does have some performance issues). Also, the below code was documented in the other User-supported SC link (can't remember the exact link name) for coding help but the link no longer appears in the support board.

This code has 4 buttons that toggle to enable or disable an action in my autotrade study: 1) Study enable/disable, 2) Long enable/disable, 3) Short enable/disable and 4) Send enable/disable. For each instrument I trade, there are 4 buttons. Each button gets it's own unique number per chart that I set in my autotrade study.

When used, I usually set to enable all but the enabled button per instrument... then when the conditions are right, immediately toggle the button so the autotrade study takes over and enters the order based on my other preset triggers and conditions.



    // 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);   

  if (sc.MenuEventID != 0)
  {
    if (sc.MenuEventID == Input_ACSButtonNumber.GetInt())
    {
     // reset button to disabled i.e. not pushed in state
     sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber.GetInt(), 0);
     if (Enabled.GetYesNo())
     {
      // change state of input to disabled and set color accordingly
      Enabled.SetYesNo(0);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber.GetInt(), COLOR_RED);
     }
     else
     {
      // change state of input to disabled and set color accordingly
      Enabled.SetYesNo(1);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber.GetInt(), RGB(0, 128, 255));
     }

    }
    else if (sc.MenuEventID == Input_ACSButtonNumber1.GetInt())
    {
      sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber1.GetInt(), 0);
      if (Long.GetYesNo())
      {
        Long.SetYesNo(0);
        sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber1.GetInt(), RGB(0, 128, 255));
      }
      else
      {
        Long.SetYesNo(1);
        sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber1.GetInt(), COLOR_RED);
      }

    }
    else if (sc.MenuEventID == Input_ACSButtonNumber2.GetInt())
    {
     sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber2.GetInt(), 0);
     if (Short.GetYesNo())
     {
      Short.SetYesNo(0);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber2.GetInt(), RGB(0, 128, 255));
     }
     else
     {
      Short.SetYesNo(1);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber2.GetInt(), COLOR_RED);
     }
  
    }  
    else if (sc.MenuEventID == Input_ACSButtonNumber3.GetInt())
    {
     sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber3.GetInt(), 0);
     if (SendOrdersToService.GetYesNo())
     {
      SendOrdersToService.SetYesNo(0);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber3.GetInt(), RGB(0, 128, 255));
     }
     else
     {
      SendOrdersToService.SetYesNo(1);
      sc.SetCustomStudyControlBarButtonColor(Input_ACSButtonNumber3.GetInt(), COLOR_RED);
     }
    }    
  }

Date Time Of Last Edit: 2021-05-17 02:23:20
imageScreenshot from 2021-05-16 22-02-15.png / V - Attached On 2021-05-17 02:02:40 UTC - Size: 2.34 KB - 182 views
imageScreenshot from 2021-05-16 22-17-58.png / V - Attached On 2021-05-17 02:18:22 UTC - Size: 66.98 KB - 188 views
[2021-05-17 02:15:47]
ertrader - Posts: 681
Later in the code, I automatically disable the enabled button after the order is entered so that entry control is given back to me:

Enabled.SetYesNo(false);
sc.SetCustomStudyControlBarButtonEnable(Input_ACSButtonNumber.GetInt(), Enabled.GetBoolean() );
Date Time Of Last Edit: 2021-05-17 02:24:04
[2021-05-18 21:20:53]
User968625 - Posts: 260
looking forward to it, it is important and I appreciate it. Thank you
[2021-05-19 10:48:38]
User968625 - Posts: 260
there is a quick solution that can help for now and I think it can help in the long term as well. Can we have an option for the "Trade Management by Study" to be always on and not tied to a button? that will help
[2021-05-19 22:58:25]
Sierra Chart Engineering - Posts: 104368
We will have a solution implemented in the next release.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2021-05-19 22:58:34
[2021-05-21 21:46:51]
User968625 - Posts: 260
ok, pls let us know when ever it is ready. thanks for the help with this one
[2021-05-25 21:34:47]
User968625 - Posts: 260
any updates on that, thank you
[2021-05-25 22:39:00]
Sierra_Chart Engineering - Posts: 18569
Update to the latest pre-release:
Software Download: Fast Update

There is nothing special you need to do now. The custom study control bar buttons will now work independently.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account