Support Board
Date/Time: Thu, 07 May 2026 07:00:29 +0000
Post From: NumPriceLevels Showing Zero in ACSIL Study
| [2026-05-07 03:04:12] |
| TraderBiku - Posts: 41 |
|
Hello, I'm trying to write a simple study to access VAP information, but getting stuck at the very start because I'm not able to get the NumPriceLevels function to show anything other than 0. I am on a 5min ES chart with number bars up, so I can visually see the ticks/levels, but the study is not able to access that information programatically. Any help would be much appreciated: #include "sierrachart.h" SCDLLName("LVNFinder") SCSFExport scsf_LVNFinder(SCStudyInterfaceRef sc) { // logging object SCString msg; // Set configuration variables if (sc.SetDefaults) { sc.GraphName = "LVNFinder"; sc.GraphRegion = 0; sc.MaintainVolumeAtPriceData = 1; sc.UpdateAlways = 1; return; } // declare a vap container const s_VolumeAtPriceV2* p_VAP = NULL; // get number of price levels in most recent visible bar int NumPriceLevels = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(sc.IndexOfLastVisibleBar); msg.Format( "MaintainVAP=%d LastVisible=%d NumPriceLevels=%d", sc.MaintainVolumeAtPriceData, sc.IndexOfLastVisibleBar, NumPriceLevels ); sc.AddMessageToLog(msg, 0); } |
