Support Board
Date/Time: Sun, 24 Nov 2024 00:54:13 +0000
Post From: Custom Study Trade DOM
[2024-07-20 14:46:56] |
User431178 - Posts: 541 |
Hello, Assuming you mean to draw within the DOM columns themselves, you cannot use subgraphs for that, you would need to use custom drawing (take a look at gdiexample.cpp in your sierrachart/acs_source folder). When using DRAWSTYLE_TEXT, you actually have to set the text value to something, otherwise the is nothing to display. The value you set in the subgraph determines only the location (price) at which to display the text. Not sure what the purpose of the inner loop here is, given that you are only looking to highlight the price levels. if (sc.GetAskMarketDepthEntryAtLevel(depthEntry, level)) { int askVolume = depthEntry.Quantity; float askPrice = depthEntry.Price; if (askVolume >= threshold) { // What is this loop for, it does not seem to fit with the logic of what you are trying to achieve? for (int i = sc.UpdateStartIndex; i < sc.ArraySize; ++i) { // so you only want to highligt the last trade price, nowhere else? if (sc.BaseData[SC_LAST][i] == askPrice) { sc.Subgraph[1][i] = askPrice; } } } } Also, you have autoloop enabled, but are referencing sc.UpdateStartIndex within the inner loops, which may (not 100% sure) always be 0 when you have autoloop set. If so that will be very inefficient. If your intention is to only draw in the DOM columns, then autoloop should be set to 0, as there is no need for the function to be called on every bar (as it would be with auto loop enabled). Maybe you can provide an example of what you expect to see, or explain in more detail? |