Support Board
Date/Time: Fri, 28 Mar 2025 23:12:12 +0000
Post From: Margin / Commision / Tick ACSIL related questions.
[2025-03-22 21:21:39] |
Dennzisme - Posts: 12 |
Hello, did some testing and couldnt figure out how to retrieve the margin requirement for the symbol and the commissions. 😣: int tickInfoButtonID = inputTickInfoButtonID.GetInt();
sc.AddACSChartShortcutMenuItem(tickInfoButtonID, sc.GraphName + " - Display Tick & Account Info"); // Handle button click for Tick & Account Info if (sc.MenuEventID == tickInfoButtonID) { // Get the tick size and value from Sierra Chart float tickSize = sc.TickSize; float tickValue = sc.CurrencyValuePerTick; // Create log message for tick info SCString tickInfoMsg; tickInfoMsg.Format("Symbol: %s | Tick Size: %.8f | Tick Value: %.8f", sc.Symbol.GetChars(), tickSize, tickValue); // Log the tick information with severity 0 (normal) sc.AddMessageToLog(tickInfoMsg, 0); // Get account data information n_ACSIL::s_TradeAccountDataFields TradeAccountDataFields; if (sc.GetTradeAccountData(TradeAccountDataFields, sc.SelectedTradeAccount)) { // Create and display account information SCString accountInfoMsg; accountInfoMsg.Format("---- ACCOUNT INFORMATION ----\n" "Account: %s (%s)\n" "Current Cash Balance: %.2f %s\n" "Available Funds: %.2f %s\n" "Account Value: %.2f %s\n" "Margin Requirement: %.2f %s\n" "Full Margin Requirement: %.2f %s\n" "Open Positions P/L: %.2f %s\n" "Daily P/L: %.2f %s\n" "--------------------------\n" "Margin Status: %s\n" "Trading Status: %s", TradeAccountDataFields.m_TradeAccount.GetChars(), TradeAccountDataFields.m_IsSimulated ? "Simulated" : "Live", TradeAccountDataFields.m_CurrentCashBalance, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_AvailableFundsForNewPositions, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_AccountValue, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_MarginRequirement, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_MarginRequirementFull, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_OpenPositionsProfitLoss, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_DailyProfitLoss, TradeAccountDataFields.m_CurrencyCode.GetChars(), TradeAccountDataFields.m_IsUnderRequiredMargin ? "UNDER REQUIRED MARGIN" : "Normal", TradeAccountDataFields.m_TradingIsDisabled ? "DISABLED" : "Enabled" ); // Log the account information with severity 0 (normal) sc.AddMessageToLog(accountInfoMsg, 0); } else { // Handle the case where we couldn't get trade account data sc.AddMessageToLog("Error: Unable to retrieve trade account data.", 1); } } When my data service is teton routing and im in SIM I get these results: 2025-03-22 22:14:14.111 | Chart: ESM25_FUT_CME[M] 500 Mil #2 | Study: Risk Manager | ---- ACCOUNT INFORMATION ----
Account: (Live) Current Cash Balance: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00 Available Funds: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00 Account Value: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00 Margin Requirement: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00 Full Margin Requirement: 0.00 Open Positions P/L: 0.00 Daily P/L: 0.00 -------------------------- Margin Status: Normal Trading Status: Enabled When im in non-simulated I get these values in my log: 2025-03-22 22:18:06.826 | Chart: ESM25_FUT_CME[M] 500 Mil #2 | Study: Risk Manager | ---- ACCOUNT INFORMATION ----
Account: 2000A (Live) Current Cash Balance: 118.98 USD Available Funds: 118.98 USD Account Value: 118.98 USD Margin Requirement: 0.00 USD Full Margin Requirement: 0.00 USD Open Positions P/L: 0.00 USD Daily P/L: 0.00 USD -------------------------- Margin Status: Normal Trading Status: Enabled Is there a way to retrieve the values for margin requiremens and commissions for the symbol the study is on? And is there a way to retrieve the correct account balance when im in simulation mode? Thanks for the help. Best regards, Dennis. Date Time Of Last Edit: 2025-03-22 21:24:01
|