Support Board
Date/Time: Fri, 31 Jan 2025 11:59:59 +0000
Post From: Array Bounds violation in dynamic arrays
[2019-04-27 06:14:42] |
User255315 - Posts: 133 |
Hi SC! If its possible for you to have just a quick look at the following loop in which i populate a dynamic array with VaP for the range of the day through sc.VolumeAtPriceForBars. I am fairly certain that this loop is throwing the exception. Any suggestions or guidelines regarding this are welcome. s_VolumeAtPriceV2* p_fill= NULL; int ProfileIndex = 0; int PriceIndex = 0; int ht = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(Index)-1; range[Index] = ht; for (int KeyIndex = 0;KeyIndex < ht+1; KeyIndex ++) { sc.VolumeAtPriceForBars->GetVAPElementAtIndex(Index, KeyIndex, &p_fill); //verify the pointer is not a null, otherwise an exception will occur if (p_fill) { float value= p_fill->Volume; p_VAP[KeyIndex]= value; //youre storing VAP in dyn mem } } This is the corresponding error message: Warning: The Custom DLL study "daily-mod.scsf_SelfContainedVB" has just caused a CPU exception. | 2019-04-26 17:11:59 * Warning: This Custom DLL study may cause Sierra Chart to be unstable until you remove the study from your chart and restart Sierra Chart. | 2019-04-26 17:11:59 * Thanks in advance! |