Support Board
Date/Time: Sat, 01 Mar 2025 06:52:37 +0000
Post From: Volume By Price access to data
[2021-09-20 00:58:23] |
ertrader - Posts: 681 |
Manual looping: #include "sierrachart.h"
SCDLLName("VBPData") SCSFExport scsf_VolumeByPriceData(SCStudyInterfaceRef sc) { SCSubgraphRef Subgraph_Volume = sc.Subgraph[0]; SCSubgraphRef Subgraph_BidVolume = sc.Subgraph[1]; SCSubgraphRef Subgraph_AskVolume = sc.Subgraph[2]; SCSubgraphRef Subgraph_DeltaVolume = sc.Subgraph[3]; SCInputRef INStudyID = sc.Input[0]; SCInputRef INProfileIndex = sc.Input[1]; if (sc.SetDefaults) { // Set the configuration and defaults sc.GraphName = "Volume By Price Data"; sc.StudyDescription = "This obtains data from Volume By Price"; sc.AutoLoop = false; sc.MaintainVolumeAtPriceData = 1; // true Subgraph_Volume.Name = "Volume"; Subgraph_Volume.DrawStyle = DRAWSTYLE_IGNORE; Subgraph_Volume.LineWidth = 2; Subgraph_BidVolume.Name = "Bid Volume"; Subgraph_BidVolume.DrawStyle = DRAWSTYLE_IGNORE; Subgraph_BidVolume.LineWidth = 2; Subgraph_AskVolume.Name = "Ask Volume"; Subgraph_AskVolume.DrawStyle = DRAWSTYLE_IGNORE; Subgraph_AskVolume.LineWidth = 2; Subgraph_DeltaVolume.Name = "Delta Ask-Bid Volume"; Subgraph_DeltaVolume.DrawStyle = DRAWSTYLE_IGNORE; Subgraph_DeltaVolume.LineWidth = 2; INStudyID.Name="Study ID"; INStudyID.SetInt(0); INStudyID.SetIntLimits(0,10000); INProfileIndex.Name="Profile Index"; INProfileIndex.SetInt(0); INProfileIndex.SetIntLimits(0,10000); return; } // Do data processing const int StudyID = INStudyID.GetInt(); const int ProfileIndex = INProfileIndex.GetInt(); int Volume, BidVolume, AskVolume; n_ACSIL::s_StudyProfileInformation StudyProfileInformation; if(sc.GetStudyProfileInformation(StudyID, ProfileIndex, StudyProfileInformation)) { Volume = StudyProfileInformation.m_Volume; BidVolume = StudyProfileInformation.m_BidVolume; AskVolume = StudyProfileInformation.m_AskVolume; } for (int Index = sc.UpdateStartIndex; Index < sc.ArraySize; ++Index) { Subgraph_Volume[Index] = Volume; Subgraph_BidVolume[Index] = BidVolume; Subgraph_AskVolume[Index] = AskVolume; Subgraph_DeltaVolume[Index] = Subgraph_AskVolume[Index]-Subgraph_BidVolume[Index]; } } |
![]() |