Support Board
Date/Time: Fri, 28 Feb 2025 21:39:24 +0000
Custom study cause CPU exception
View Count: 845
[2021-08-26 19:53:59] |
dnrich - Posts: 18 |
Hi, I create a simple custom study and use remote build to compile this study. Until then, everything is ok. But when I had this custom study to a chart, it displays the following log message until I remove the study to the chart: Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:21.257 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:21.257 * Here is a copy of all the logs : Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:20.735 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:20.735 * Software version: 2299 64-bit | 2021-08-26 21:21:20.856 Primary Thread ID: 7932 | 2021-08-26 21:21:20.856 Usage end date: 2021-10-09 | 2021-08-26 21:21:20.856 Enabled for: Advanced Features 2. | 2021-08-26 21:21:20.856 Enabled for: Sierra Chart Historical Data Service. | 2021-08-26 21:21:20.856 Enabled for: Denali Real-Time Exchange Data Feed. | 2021-08-26 21:21:20.856 Enabled for: Delayed Denali Exchange Data Feed. | 2021-08-26 21:21:20.856 Enabled for exchange2: CME | 2021-08-26 21:21:20.856 Allow Support for Sierra Chart Data Feeds is enabled. | 2021-08-26 21:21:20.856 Current selected Data/Trading service: SC Data - All Services | 2021-08-26 21:21:20.856 Custom symbol settings values: enabled | 2021-08-26 21:21:20.856 Chart Update Interval: 500 | 2021-08-26 21:21:20.856 Intraday Data Storage Time Unit: 0 | 2021-08-26 21:21:20.856 Time Zone: +02:00:00 (CET+01CEST+01,M3.5.0/02:00,M10.5.0/03:00) | 2021-08-26 21:21:20.856 2021-08-26 19:21:20 Local computer time in UTC | 2021-08-26 21:21:20.856 2021-08-26 21:21:20 Local computer time in SC Time Zone | 2021-08-26 21:21:20.856 2021-08-26 17:36:19 Server time in UTC | 2021-08-26 21:21:20.856 Local computer UTC time and Server UTC time difference: 1 seconds. | 2021-08-26 21:21:20.856 Program path: C:\SierraChart\ | 2021-08-26 21:21:20.856 Data Files path: C:\SierraChart\Data\ | 2021-08-26 21:21:20.856 OS Version Number: 10.0 | 2021-08-26 21:21:20.856 Locale Setting: C | 2021-08-26 21:21:20.856 DLLs: ETOFSv2.0.dll, ETOFSv2.0_64.dll, ETOFSv3.dll, ETOFSv3_64.dll, My Custom Study DLL.dll, My Custom Study DLL_PCHP-RICHARD_août-25-205729-2020_Conflict.dll, RichardStudies2_64.dll, RichardStudies_64.dll, test23_64.dll, test_64.dll, UserContributedStudies.dll, UserContributedStudies_64.dll | 2021-08-26 21:21:20.857 Allowed protected custom studies: Emoji Trading Order Flow Suite v2 | 2021-08-26 21:21:20.857 Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:21.257 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:21.257 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:21.742 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:21.742 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:22.259 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:22.259 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:22.763 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:22.763 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:23.271 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:23.271 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:23.795 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:23.795 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:24.309 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:24.309 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:24.803 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:24.803 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:25.315 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:25.315 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:25.818 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:25.818 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:26.333 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:26.333 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:26.825 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:26.825 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:27.346 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:27.346 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:27.841 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:27.841 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:28.335 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:28.335 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:28.842 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:28.842 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:29.339 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:29.339 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:29.846 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:29.846 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:30.340 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:30.340 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:30.850 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:30.850 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:31.343 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:31.343 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:31.836 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:31.836 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:32.362 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:32.362 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:32.856 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:32.856 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:33.352 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:33.352 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:33.868 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:33.868 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:34.372 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:34.372 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:34.873 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:34.873 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:35.366 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:35.366 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:35.861 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:35.861 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:36.396 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:36.396 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:36.890 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:36.890 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:37.395 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:37.395 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:37.892 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:37.892 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:38.402 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:38.402 * Warning: The Custom DLL study "test23.scsf_dnr_candle_delta_divergence2" has just caused a CPU exception. | 2021-08-26 21:21:38.536 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from the chart and restart Sierra Chart. | 2021-08-26 21:21:38.536 * HTTPS connection ID:4 to build.sierrachart.com:443 for request ID:4 (3) | Timed out waiting for shutdown. Performing an immediate socket close. | 2021-08-26 21:22:15.410 HTTPS connection ID:4 to build.sierrachart.com:443 for request ID:4 (3) | Closed. | 2021-08-26 21:22:15.411 HTTPS connection ID:5 to build.sierrachart.com:443 for request ID:5 (2) | Timed out waiting for shutdown. Performing an immediate socket close. | 2021-08-26 21:22:45.413 HTTPS connection ID:5 to build.sierrachart.com:443 for request ID:5 (2) | Closed. | 2021-08-26 21:22:45.413 HTTPS connection ID:4 to build.sierrachart.com:443 for request ID:4 (3) | Deleting network socket now after delay. | 2021-08-26 21:22:45.413 HTTPS connection ID:5 to build.sierrachart.com:443 for request ID:5 (2) | Deleting network socket now after delay. | 2021-08-26 21:23:15.427 You can find the study source in attached file. If I put in comment line 91, the program does not display an error message. This line does not contain any particular error. Thank you for your help, Richard. |
![]() |
[2021-08-27 07:34:04] |
User907968 - Posts: 833 |
The problem lies here - for (int VAPIndex = 0; VAPIndex <= VAPSizeAtBarIndex-1; VAPIndex++) { DeltaCandle += p_VolumeAtPrice->AskVolume - p_VolumeAtPrice->BidVolume; } You are dereferencing a null pointer, p_VolumeAtPrice, which is/causes undefined behavior. Modfiy the for loop similarly to one of the options below. for (int VAPIndex = 0; VAPIndex < VAPSizeAtBarIndex; VAPIndex++) { s_VolumeAtPriceV2* p_VolumeAtPrice = NULL; // set pointer to null on each iteration sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, VAPIndex, &p_VolumeAtPrice); // read volume at price data / set pointer if (p_VolumeAtPrice != NULL) // check for null pointer DeltaCandle += p_VolumeAtPrice->AskVolume - p_VolumeAtPrice->BidVolume; } for (int VAPIndex = 0; VAPIndex < VAPSizeAtBarIndex; VAPIndex++) { s_VolumeAtPriceV2* p_VolumeAtPrice = NULL; // set pointer to null on each iteration if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, VAPIndex, &p_VolumeAtPrice)) // read volume at price data / set pointer continue; // above function returns false on failure to set pointer, in which case loop moves to next iteration without executing code below DeltaCandle += p_VolumeAtPrice->AskVolume - p_VolumeAtPrice->BidVolume; } |
To post a message in this thread, you need to log in with your Sierra Chart account: