Support Board
Date/Time: Sun, 31 Aug 2025 10:09:40 +0000
Closing all open trades multiple symbols
View Count: 1603
[2022-10-26 19:45:04] |
User456188 - Posts: 3 |
How to close all open trades on multiple symbols at the same time?
|
[2022-10-26 20:35:03] |
John - SC Support - Posts: 41535 |
There is are Control Bar and Keyboard options for Trade Flatten All Positions All Accounts. Refer to the following: Control Bar: Customize Control Bars >> Control Bar 1-12 (Global Settings) Global Settings Menu: Customize Keyboard Shortcuts (Global Settings menu) For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2022-10-27 11:02:36] |
User456188 - Posts: 3 |
Trade Flatten All Positions All Accounts function is not working. I tried the Control Bar button and the Keyboard Shortcuts same result. the flatten only function does for one symbol at a time. I need to click on each chart separately to activate it and do it. I trade two symbols at the same time and i need to close the 2 positions at the exact time. I'am on Sim at the moment and the Trade service log is not showing anything and the message log also. Thanks |
[2022-10-27 15:23:57] |
John - SC Support - Posts: 41535 |
Your Sierra Chart account which you have logged into this Support Board with is expired. So we know what Sierra Chart account you are using, go to Help >> Support Board from within the Sierra Chart desktop program and then post in this thread telling us this is done.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-01-19 14:57:23] |
DualADX - Posts: 39 |
There is are Control Bar and Keyboard options for Trade Flatten All Positions All Accounts.
John, I have Trade Flatten All Positions - All Accounts and Cancel Orders All Symbols All Accounts setup as buttons on my Control Bar. I have the Global Settings>>Chart Trade Settings>>General>>Disable Order Confirmations = Yes. Also, all confirmations are unchecked in my Attached Trade Window Menu. I am still getting a pop up window to confirm closing/flattening positions. Is there another menu somewhere that needs a setting changed so that I do not have to confirm? Thank you |
[2023-01-19 16:25:12] |
John - SC Support - Posts: 41535 |
There is not a way to prevent the pop-up confirmation that comes up when using "Flatten All Positions - All Accounts".
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-01-19 19:31:51] |
DualADX - Posts: 39 |
Not a way currently? Or not a way to implement it ever? Seems to me if I wanted to flatten all positions all accounts I’d want to do it ASAP without wasting time with a confirmation. I guess that’s just me. |
[2023-01-19 22:14:34] |
John - SC Support - Posts: 41535 |
Not a way currently. But we can't say when, or if, we will get to changing that particular pop-up.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-01-05 19:34:27] |
n8trading - Posts: 46 |
Is Trade Flatten All Positions All Accounts intended to also include All Symbols? This does not appear to be working on multiple positions across multiple symbols in Sim mode.
|
[2024-01-06 10:49:24] |
Sierra_Chart Engineering - Posts: 20774 |
That command will not work in Trade Simulation Mode.
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 |
[2024-03-27 15:13:32] |
af_99 - Posts: 24 |
That command will not work in Trade Simulation Mode.
Is there any way than to flatten all positions in Simulation mode? (Whatever will be okay but I can´t see any...). Thank you very much. |
[2024-03-27 16:17:32] |
John - SC Support - Posts: 41535 |
There simply is not an option to close all positions for all symbols and all accounts in Simulation Mode. You would need to do it chart by chart.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-07-25 16:50:30] |
TonyCipriani - Posts: 47 |
Hello, is there a way to have multiple 'Flatten Positions at Set Times' for each product? In the Global Profit / Loss Management, I have it set it to close before the equity markets close at 15:59:59, but if we're trading multiple markets like say Treasuries, I'd want to flatten all Bond positions at 14:59:59, Crude oil at 14:29:59. Instead of a Global setting, is there a way to only implement it based on either the symbol or even the chart? I'm thinking of having a separate instance for each symbol, but even then, I think the Global Profit management would still be based on the main instance (I saw the doc which says to avoid using this setting in sub-instances). Thanks |
[2025-07-25 17:33:13] |
TonyCipriani - Posts: 47 |
Update: If you're looking for a way to have different auto-liquidation times apart from the one currently within the Global Profit / Loss Management setting, where you require closing positions at different times due to trading multiple markets, you can use this custom ACSIL study that I've attached. This was generated with the assistance of Google's Gemini AI. Disclaimer: This code was generated to meet a specific request. Please test it thoroughly in a simulated or replay environment before using it in a live trading account. Use at your own risk. #include "sierrachart.h"
SCDLLName("SymbolSpecificAutoCloseWithSeconds") SCSFExport scsf_SymbolSpecificAutoCloseWithSeconds(SCStudyInterfaceRef sc) { // A single input for the user to set the liquidation time as a string SCInputRef LiquidationTimeInput = sc.Input[0]; if (sc.SetDefaults) { sc.GraphName = "Symbol Specific Auto Close (HH:MM:SS)"; sc.StudyDescription = "Closes all positions for the chart's symbol at a specified time entered in HH:MM:SS format."; sc.AutoLoop = 1; // Process the study on every chart update sc.GraphRegion = 0; LiquidationTimeInput.Name = "Liquidation Time (HH:MM:SS format)"; LiquidationTimeInput.SetString("15:59:50"); // Set default value return; } // Get the time string from the input const char* liqTimeString = LiquidationTimeInput.GetString(); // Parse the string to get hour, minute, and second int liqHour = 0, liqMinute = 0, liqSecond = 0; int parseResult = sscanf_s(liqTimeString, "%d:%d:%d", &liqHour, &liqMinute, &liqSecond); // Only proceed if the string was parsed correctly into three numbers if (parseResult == 3) { // Get the current time from the Sierra Chart server SCDateTime CurrentDateTime = sc.GetCurrentDateTime(); int CurrentHour = CurrentDateTime.GetHour(); int CurrentMinute = CurrentDateTime.GetMinute(); int CurrentSecond = CurrentDateTime.GetSecond(); // Check if the current time is at or past the liquidation time if (CurrentHour > liqHour || (CurrentHour == liqHour && CurrentMinute > liqMinute) || (CurrentHour == liqHour && CurrentMinute == liqMinute && CurrentSecond >= liqSecond)) { // Check if there is an open position for the chart's symbol s_SCPositionData PositionData; sc.GetTradePosition(PositionData); if (PositionData.PositionQuantity != 0) { sc.FlattenAndCancelAllOrders(); } } } } |
[2025-07-25 19:42:34] |
John - SC Support - Posts: 41535 |
There is a "Flatten and Cancel At Set Time" on the Trade Window under the "A" tab. This will flatten and cancel for the specific symbol of the chart and the Trading Account that the Trade Window is setup for. Refer to the following: Basic Trading and the Trade Window: A >> Flatten And Cancel at Set Time For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-07-25 20:11:55] |
TonyCipriani - Posts: 47 |
Thank you. I see that the function is native side, so it would be great if we can get that on server-side instead. Thanks. |
To post a message in this thread, you need to log in with your Sierra Chart account: