Support Board
Date/Time: Sat, 23 Nov 2024 19:01:17 +0000
[Programming Help] - How to make total P/L show for copy traded accounts
View Count: 324
[2024-08-09 08:14:48] |
Damn Good Trading - Posts: 7 |
Hi im a youtuber and was wondering if there's some hidden way to show the total P/L for the trade or day in one place across copy traded accounts. I see it for the one account but for shorts and reels people like to see the total P/L across all accounts. Is there anyway to have a script or something running on SC to add P/L from all accounts and show it in the little box on the dom or just somewhere visible on the screen?
|
[2024-08-09 12:28:20] |
Sierra_Chart Engineering - Posts: 17150 |
Have a look at the Trade Statistics for Charts tab: Trade Activity Log: Trade Statistics for Charts (Chart Stats) Tab It has a total row. With this Chart Setting you can control what chart is included there: Chart Settings: Include Chart Trade List in Trade Statistics for Chart Window (Chart >> Chart Settings >> Trading menu) (We still need to document this) 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: 2024-08-09 12:28:39
|
[2024-08-09 12:45:54] |
Damn Good Trading - Posts: 7 |
Ok great thanks for that. What is this box on the left hand side called? Also are you saying there is a way to get that total row put into that P/L box that I circled in the image?
|
Attachment Deleted. |
[2024-08-09 14:56:09] |
John - SC Support - Posts: 36238 |
There is not a way to show multiple accounts in the Trade Window. Each Trade Window is specific to a chart and to the account that is selected on there. The only way to view the full Profit/Loss is on the Trade Activity Log as noted above. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-08-09 19:22:14] |
Sierra_Chart Engineering - Posts: 17150 |
On the Trade Activity Log, select the Chart Stats tab.
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-08-12 21:53:04] |
Damn Good Trading - Posts: 7 |
Ok awesome i found it. Is there a way to make it net daily P/L instead of closed P/L? Also a way to put it under the trade window and so it moves actively while I'm in a trade? People love to see the fluctuations etc in real time. Im assuming the open p/l will do it on the 2nd row for all 20 accounts so is there a way to customize it for just those 2 columns and put it under the trade window or just somewhere its visible on the screen without all the extra buttons on the top of the Trade Activity log?
|
Attachment Deleted. sc screenshot.png / V - Attached On 2024-08-12 21:53:02 UTC - Size: 171.52 KB - 55 views |
[2024-08-13 07:21:39] |
seandunaway - Posts: 268 |
i'm a noob but see if something like this works.. dll attached i haven't figured out how to make it work with sim# accounts #include <sierrachart.h>
#undef SC_DLL_VERSION #define SC_DLL_VERSION 2563 SCDLLName("all accounts pnl") SCSFExport scsf_all_accounts_pnl(SCStudyInterfaceRef sc) { SCSubgraphRef subgraph = sc.Subgraph[0]; SCInputRef x = sc.Input[0]; SCInputRef y = sc.Input[1]; SCInputRef bold = sc.Input[2]; SCInputRef open = sc.Input[3]; if (sc.SetDefaults) { sc.AutoLoop = 0; sc.DisplayStudyName = 0; sc.GraphName = "all accounts pnl"; sc.GraphRegion = 0; subgraph.DrawStyle = DRAWSTYLE_CUSTOM_TEXT; subgraph.LineWidth = 24; subgraph.Name = "all accounts pnl"; subgraph.PrimaryColor = RGB(0, 0, 0); subgraph.SecondaryColor = RGB(255, 255, 255); subgraph.SecondaryColorUsed = 1; int max_x = (int) CHART_DRAWING_MAX_HORIZONTAL_AXIS_RELATIVE_POSITION; x.Name.Format("x (1-%d)", max_x); x.SetInt(10); x.SetIntLimits(1, max_x); int max_y = (int) CHART_DRAWING_MAX_VERTICAL_AXIS_RELATIVE_POSITION; y.Name.Format("y (1-%d)", max_y); y.SetInt(90); y.SetIntLimits(1, max_y); bold.Name = "bold"; bold.SetYesNo(false); open.Name = "open"; open.SetYesNo(true); return; } double total = 0.00; for (int i = 0; i < sc.GetNumTradeAccounts(); i++) { SCString account; sc.GetTradeAccountAtIndex(i, account); n_ACSIL::s_TradeAccountDataFields account_data; sc.GetTradeAccountData(account_data, account); total += account_data.m_DailyProfitLoss; if (open.GetBoolean()) { total += account_data.m_OpenPositionsProfitLoss; } } SCString output; output.Format("%.2f", total); sc.AddAndManageSingleTextDrawingForStudy( sc, false, x.GetInt(), y.GetInt(), subgraph, 0, output, sc.DrawStudyUnderneathMainPriceGraph ? 0 : 1, (int) bold.GetBoolean() ); } Date Time Of Last Edit: 2024-08-15 08:20:26
|
all_accounts_pnl_64.dll - Attached On 2024-08-13 10:16:54 UTC - Size: 130.5 KB - 113 views all_accounts_pnl_arm64.dll - Attached On 2024-08-13 10:17:06 UTC - Size: 121.5 KB - 93 views |
[2024-08-13 07:33:24] |
Damn Good Trading - Posts: 7 |
Dope I'll try it. Add it to the data folder or where should I add these?
|
[2024-08-13 07:40:56] |
seandunaway - Posts: 268 |
yeah! :)
Date Time Of Last Edit: 2024-08-13 07:42:35
|
adding custom study.png / V - Attached On 2024-08-13 07:40:47 UTC - Size: 255.65 KB - 43 views |
[2024-08-13 11:19:58] |
seandunaway - Posts: 268 |
i screenshared with @Damn Good Trading and his study updates very differently than mine i have 3 accounts that happily update each tick. he has 20 accounts that start off updating for a dozen ticks or so and then freeze until the position is closed or a new order is entered. it's weird because chart studies and chart performance shows negligible latency @engineering and friends, is there a precedent for studies being disabled or throttled? do you have any suggestions on how this may be improved or how to troubleshoot it? i tried pulling GetNumTradeAccounts() and the variable declarations out of the loop with no improvement is it worth using some persistence to keep the trade accounts? perhaps GetTradeAccountData() is too expensive or not local and is trying to query the trade route 20 times every update?! Date Time Of Last Edit: 2024-08-13 12:28:39
|
[2024-08-16 00:10:35] |
Sierra_Chart Engineering - Posts: 17150 |
GetTradeAccountData() is only getting the data held within Sierra Chart. There is no remote request. It should only be called at most once every study function call at the absolute most. 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-08-17 07:54:25] |
seandunaway - Posts: 268 |
ok i'll try keeping a persistent index and query only once per chart update interval and update output only after number of accounts x chart update interval.. or add to a persistent total pnl makes sense and i guess that's similar to how autolooping works. thank you Date Time Of Last Edit: 2024-08-17 08:07:42
|
To post a message in this thread, you need to log in with your Sierra Chart account: