Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 02:36:35 +0000



Functions for access account information?

View Count: 100

[2025-02-17 14:57:32]
atariaf - Posts: 12
Are there no functions for access account information when creating custom studies? For example, being to access available margin or account balances for creating dynamic sizing calculations in ACSIL studies. I wasn't able to find anything when looking through the docs.

Regards,
[2025-02-17 16:10:44]
cmet - Posts: 690
sc.GetTradeAccountData()
sc.GetTradeServiceAccountBalanceForTradeAccount()
sc.GetTotalNetProfitLossForAllSymbols()
[2025-02-17 16:34:27]
atariaf - Posts: 12
Now, to figure out where the TradeDataFields are located.

I am having the hardest time figuring out the logic to the documentation.

The sc.GetTradeAccountData() looks like it is what I need, but where do I find what fields are available in this? I can see that m_AccountValue is available, but what else? There is no link to this in the docs.

I would really rather not print the entire return to the log just to see what information is available. No matter what way I type "n_ACSIL::s_TradeAccountDataFields", I can't find anything. I've checked the files in ACS_Source as well to see if there any structs or indications of what can fields can be obtained this way, but it looks like all of those files are really just examples and headers. I found the function/SCDLLCALL in the sierrachart.h, but I can't find anything else.

Any help would be greatly appreciated.

Refards,
[2025-02-17 16:38:35]
atariaf - Posts: 12
Found it in the structs.h file. grep coming in clutch.


struct s_TradeAccountDataFields
{
  SCString m_TradeAccount;
  uint8_t m_IsSimulated = 0;
  SCString m_CurrencyCode;
  double m_CurrentCashBalance = 0;
  uint64_t m_TransactionIdentifierForCashBalanceAdjustment = 0;
  double m_AvailableFundsForNewPositions = 0;
  double m_MarginRequirement = 0;
  double m_MarginRequirementFull = 0;
  double m_MarginRequirementFullPositionsOnly = 0;
  double m_PeakMarginRequirement = 0;
  double m_AccountValue = 0;
  double m_OpenPositionsProfitLoss = 0;
  double m_DailyProfitLoss = 0;
  double m_CalculatedDailyNetLossLimitInAccountCurrency = 0;
  double m_TrailingAccountValueAtWhichToNotAllowNewPositions = 0;
  uint8_t m_DailyNetLossLimitHasBeenReached = 0;
  uint8_t m_IsUnderRequiredMargin = 0;
  uint8_t m_IsUnderRequiredAccountValue = 0;
  uint8_t m_TradingIsDisabled = 0;
  uint8_t m_ClosePositionsAtEndOfDay = 0;
  SCString m_Description;
};

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

Login

Login Page - Create Account