Support Board
Date/Time: Tue, 25 Mar 2025 21:54:13 +0000
[Programming Help] - Margin / Commision / Tick ACSIL related questions.
View Count: 200
[2025-03-20 20:42:36] |
Dennzisme - Posts: 12 |
Hello Sierra Chart community, Commission: Is it possible to read the value from Trade Account Monitor/Balances Window → Symbol Commissions → "Trade Fee Per Contract (one side)" using ACSIL? Margin: Can ACSIL retrieve the "Account Margin (Read Only)" value? Also, does it update automatically when the broker changes the margin requirements? (if not is there a way to call the update without manually pressing the button in ACSIL?) Tick: Can ACSIL access a symbol's Tick Size and Tick Value? Best regards, Dennis |
[2025-03-21 01:15:39] |
ForgivingComputers.com - Posts: 1030 |
Tick:
Yes. sc.TickSize and sc.CurrencyValuePerTick
Can ACSIL access a symbol's Tick Size and Tick Value? Date Time Of Last Edit: 2025-03-21 03:38:50
|
[2025-03-21 02:18:40] |
Sierra_Chart Engineering - Posts: 18944 |
Margin:
This actually is fully supported with Teton order routing and the trading evaluator services. Refer to:Can ACSIL retrieve the "Account Margin (Read Only)" value? Also, does it update automatically when the broker changes the margin requirements? (if not is there a way to call the update without manually pressing the button in ACSIL?) ACSIL Interface Members - Functions: sc.GetTradeAccountData() It does update, as margin requirements change but not necessarily instantly. 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 Date Time Of Last Edit: 2025-03-21 02:19:02
|
[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
|
[2025-03-22 21:45:24] |
Sierra_Chart Engineering - Posts: 18944 |
You cannot get the margin requirement for a symbol unless you actually have a working order or position. In this last case the actual margin will be provided. For internal simulated trading margin and account balances are not supported. 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 |
[2025-03-22 22:10:17] |
Dennzisme - Posts: 12 |
Thanks for the reply. Is the margin data up to date when I manually request it by clicking the button? (Considering the slight delay you mentioned earlier.) Path: Trade > Trade Account Monitor/Balances Window > Margin > Add the symbol and press [Request Margin Data] If so, would it be possible to add this as a function in ACSIL? This would allow retrieving the symbol margin without having to open a position, which would be very helpful. Thanks! Best regards, Dennis |
To post a message in this thread, you need to log in with your Sierra Chart account: