Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 15:34:42 +0000



[Programming Help] - ACSIL Volume By Price

View Count: 610

[2023-07-28 09:39:33]
vddfollow - Posts: 18
Dear all,

Where can I access Volume By Price .cpp file ?
I would like to make an ACSIL custom study based on the SC VBP Study ?
How can I proceed ?

Regards,
J
[2023-07-28 12:42:52]
User431178 - Posts: 544
Where can I access Volume By Price .cpp file ?

You can't, it is not available.
How to Build an Advanced Custom Study from Source Code: Source Code for Some Built in Studies Not Available

VAP data is available though, so nothing to stop you making your own version.
ACSIL Interface Members - Variables and Arrays: sc.VolumeAtPriceForBars
[2023-07-28 13:06:03]
JohnR - User831573 - Posts: 306
J,

I believe the source to that is not available. But, there is source and some docs that shows how to access the B/A volumes at each price level, I used this as a starting point to create custom code.

Programmatically Accessing Volume at Price Data
Volume By Price Study: Programmatically Accessing Volume at Price Data

Then in Studies8.cpp there is an example that accesses the arrays of B/A members at each level


/*=====================================================================
  Volume At Price array test.
----------------------------------------------------------------------------*/
SCSFExport scsf_VolumeAtPriceArrayTest(SCStudyInterfaceRef sc)

Below is some of my code


  s_VolumeAtPriceV2* p_VolumeAtPrice = nullptr;
  int JOR_BarHighBidVol = 0;
  int JOR_BarLowBidVol = 0;
  int JOR_BarHighAskVol = 0;
  int JOR_BarLowAskVol = 0;


  // Now get the Bid & Ask Trade Volumes for the High and Low of the bar
  
  // Get the # of price levels - remember array start @ zero - so subtract 1 from count
  int JOR_BarPriceLevels = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(sc.Index) - 1;

  // zero array is lowest price level
  if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, 0, &p_VolumeAtPrice))
    return;
  JOR_BarLowBidVol = p_VolumeAtPrice->BidVolume;
  JOR_BarLowAskVol = p_VolumeAtPrice->AskVolume;
  
  // Highest price level in last array element
  if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, JOR_BarPriceLevels, &p_VolumeAtPrice))
    return;
  JOR_BarHighBidVol = p_VolumeAtPrice->BidVolume;
  JOR_BarHighAskVol = p_VolumeAtPrice->AskVolume;

Hope this helps,
JohnR
Date Time Of Last Edit: 2023-07-28 13:36:07

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account