Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 00:12:24 +0000



Post From: CPU Exceptions from Custom Studies

[2025-02-22 14:59:57]
Deiter - Posts: 13
By the way, this is where I'm at now - four different trade signals (Buy/Sell Entry, Buy/Sell Exit), displayed as ACS drawings at the price point where they occurred. The drawings provided by the SC spreadsheet studies are fantastic, but I found that having the drawings at either the top or bottom of a chart bar was not granular enough for my trading style--hence my delightful recent descent into the world of ACSIL and C++.

The key issue was controlling the rapid growth in the number of ACS drawings on the chart and the subsequent slow down in the chart (just like the SC documentation warns about). That's where a persistent double-ended queue came in. The attached GIF shows the 20 most recent trade signals being kept, while anything older gets deleted--the chart stays nice and responsive. For debugging, I used good ol' "print statements" to monitor variables, writing to the SC Message Log via sc.AddMessageToLog(). For context, this was from yesterday's NQ action, viewed on a 1k Volume chart.

I have some other ideas that I'll tinker with (e.g. add the ability to persist a certain number of drawings on each bar, to preserve some "visual memory" of the trade signals while still keeping the overall number of drawings under control), but the big hurdle for this idea has been cleared. The next major effort will be creating an ACSIL trade system so that I can back-test my criteria properly. I've done a lot of this via the awesome SC Spreadsheet System/Alert for Trading; now I get to throw some ACSIL at it :)

In addition to your insight about de-referencing a NULL pointer, @ondafringe, the following posts and docs were crucial (you already know all this, @ondafringe, I list this for future users who attempt something similar:
ACSIL Programming Concepts: Allocating Memory for Classes
Using Drawing Tools From an Advanced Custom Study: sc.DeleteACSChartDrawing()
Date Time Of Last Edit: 2025-02-22 15:09:44
imageChart settings for 1k Volume.png / V - Attached On 2025-02-22 15:09:25 UTC - Size: 62.99 KB - 21 views
image2025-02-21_GIF of Trading Signal ACS drawings.gif / V - Attached On 2025-02-22 15:09:32 UTC - Size: 9.6 MB - 20 views