Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 00:24:39 +0000



Post From: Is it possible to have a drop down list as an input for a study setting?

[2025-02-19 00:49:49]
seandunaway - Posts: 348
probably something like this

#include <sierrachart.h>

SCDLLName("account menu")
SCSFExport scsf_account_menu (SCStudyInterfaceRef sc)
{
  SCInputRef account_id = sc.Input[0];

  if (sc.SetDefaults)
  {
    sc.GraphName = "account menu";
    sc.GraphRegion = 0;

    SCString custom_input_string;
    int number_of_accounts = sc.GetNumTradeAccounts();

    for (int i = 0; i < number_of_accounts; i++)
    {
      SCString account_name;
      sc.GetTradeAccountAtIndex(i, account_name);

      custom_input_string.Append(account_name);
      custom_input_string.Append(";");
    }

    account_id.Name = "account";
    account_id.SetCustomInputStrings(custom_input_string);
    account_id.SetCustomInputIndex(0);

    return;
  }

  SCString output;
  output.AppendFormat("Account selected - ID: %d Name: %s\n", account_id.GetIndex(), account_id.GetSelectedCustomString().GetChars());

  sc.AddMessageToLog(output, 1);
}

Date Time Of Last Edit: 2025-02-19 00:53:13
imageaccount_menu.png / V - Attached On 2025-02-19 00:53:09 UTC - Size: 68.85 KB - 37 views