Support Board
Date/Time: Mon, 21 Apr 2025 04:44:16 +0000
[Programming Help] - Problem with sc.GetOrderFillEntry / s_SCOrderFillData in versions 2742+
View Count: 391
[2025-03-05 10:49:37] |
User907968 - Posts: 840 |
I have a problem with trading systems built on version of Sierra Chart earlier than 2742. In the latest versions of SC, when sc.GetOrderFillEntry is called, either the program immediately crashes, or the cpu exception message appears in the message log. I notice that at version 2742, the s_SCOrderFillData structure had a new member added and was updated to version 5, I would assume that it is related to this change, but maybe I am wrong. Here is are some example of code from one of the systems: const auto listSize = sc.GetOrderFillArraySize(); if (listSize == 0) return; auto orderFills = std::vector<s_SCOrderFillData>{}; auto listIndex = listSize; auto orderFill = s_SCOrderFillData{}; while (listIndex > 0) { listIndex--; if (!sc.GetOrderFillEntry(listIndex, orderFill)) continue; orderFills.push_back(orderFill); } Here is the output when sc.GetOrderFillEntry is called in the above example: A breakpoint instruction (__debugbreak() statement or a similar call) was executed in SierraChart_64.exe.
Unhandled exception at 0x00007FF924E0F3C9 (ntdll.dll) in SierraChart_64.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FF924E797F0). auto fillIndex = sc.GetOrderFillArraySize(); if (fillIndex == 0) return false; while (fillIndex > 0) { auto order = s_SCOrderFillData{}; if (!sc.GetOrderFillEntry(--fillIndex, order)) continue; if (order.InternalOrderID == orderID) return true; } Here is the output when sc.GetOrderFillEntry is called with this example: Run-Time Check Failure #2 - Stack around the variable 'order' was corrupted.
Exception thrown at 0x0000000140459A9E in SierraChart_64.exe: 0xC0000005: Access violation reading location 0x0000000000000298. |
[2025-03-05 22:24:28] |
TB7000 - Posts: 14 |
Hi, I've also updated to the most recent version (from 2718 to 2744) and SC crashes immediately as soon as an order is placed. The crash is caused by two custom build studies, which are triggered by the order execution. They both use sc.GetOrderFillEntry just like the user above. if (positionData.PositionQuantity != 0 && currentTrade.isNewTrade(positionData.PositionQuantity)) { s_SCOrderFillData fillData; if (sc.GetOrderFillEntry(sc.GetOrderFillArraySize() - 1, fillData)) { ... Run-Time Check Failure #2 - Stack around the variable 'fillData' was corrupted.
Additional Information: - All testing has been done with the concerned studies in isolation and on blank chart book. - Rolling back to 2718 solves the issue. - Did not test other versions in between. I’d appreciate your support and attention to this matter. Looking forward to your response. Update: - Tested different versions in between, issue starts with version 2742 and higher (not crashing with 2741), just like the user above has mentioned. 2741 is not a temporary solution neither, as other third party provider of custom studies have adapted to 2742 and these products do no longer run below that version. Date Time Of Last Edit: 2025-03-05 22:54:09
|
[2025-03-06 12:26:21] |
TB7000 - Posts: 14 |
Issue Resolved: s_SCOrderFillData Crashes in SC v2742+ The crashes caused by sc.GetOrderFillEntry() in Sierra Chart v2742+ can be easily fixed by recompiling old code with the updated ACS_Source files. Solution: - Update Sierra Chart to v2742 or higher (currently v2744). - Recompile your custom studies with the updated ACS_Source files. If using an external IDE, ensure the correct ACS_Source directory is included in your compiler settings. - Replace the old compiled study DLL with the newly compiled version. Suspected explanation: This is an issue on the behalf of the developer handling updates, not a sierra chart issue. The s_SCOrderFillData structure was updated to version 5 in v2742 (as mentioned by the previous user). Custom studies must be compiled with the same structure version to avoid mismatches that cause crashes. Everything is working fine for now after having recompiled my codes. Date Time Of Last Edit: 2025-03-06 12:26:45
|
[2025-03-06 13:03:55] |
User907968 - Posts: 840 |
The crashes caused by sc.GetOrderFillEntry() in Sierra Chart v2742+ can be easily fixed by recompiling old code with the updated ACS_Source files. I would've never worked that out on my own... Very easy when you are talking about recompiling your code for your own use. Not so easy when that update and the reason for it has to communicated to/managed for many clients with many different systems. |
[2025-03-06 13:08:00] |
User907968 - Posts: 840 |
@ SC Engineering This is not programming help. There appears to be a change in version 2742 that breaks compatibility with studies complied on earlier versions. If there is no possibility to remedy this at your end, may I ask that you put something in the change log that explains the situation? Date Time Of Last Edit: 2025-03-06 13:12:53
|
[2025-03-06 13:23:31] |
TB7000 - Posts: 14 |
I would've never worked that out on my own...
Very easy when you are talking about recompiling your code for your own use. Not so easy when that update and the reason for it has to communicated to/managed for many clients with many different systems. Not sure if that was meant sarcastically, but I’d say you pretty much worked it out yourself already — you pinpointed the exact issue in your first post! I fully agree that managing this across multiple clients with different systems is a whole different level of complexity. Still, I appreciate you sharing your detailed findings in your initial post—it was really helpful for others affected by the same matter! |
[2025-03-07 17:46:50] |
Sierra_Chart Engineering - Posts: 19285 |
We determined the reason for the problem and it will be resolved in the next release. We will put this out in about one hour.
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-07 17:50:24] |
User907968 - Posts: 840 |
Thank you, you guys are the best!
|
[2025-03-07 20:49:24] |
Sierra_Chart Engineering - Posts: 19285 |
The new version has been released.
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 |
To post a message in this thread, you need to log in with your Sierra Chart account: