Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 21:51:01 +0000



VbP study request

View Count: 498

[2023-06-26 17:17:09]
ertrader - Posts: 672
Hi Support.

Would it be possible to add/update one of the following options:

1) Update the numbers bars studies (Numbers Bars Calculated Values and Numbers Bars Calculated Values 2) so they work on a VbP study in addition to Numbers bars (using based on option in the studies)

or

2) Create 2 new studies that return the same data as the numbers bars calculated studies but work on a VbP. (VbP calculated values and if needed VbP calculated values 2)
[2023-06-26 18:02:39]
Sierra_Chart Engineering - Posts: 17198
1. No, those studies are not meant to be based on other studies.

2. We recommend developing this yourself. Refer to:

ACSIL Interface Members - sc.Subgraph Array: Numeric Information Table Graph Draw Type
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-06-30 20:34:28]
ertrader - Posts: 672
Yes, I have written my own study now. However, to complete it, there are 2 additional calls needed in: sc.GetStudyProfileInformation in the member: n_ACSIL::s_StudyProfileInformation

Can you please add the following members to the sc.GetStudyProfileInformation and member s_StudyProfileInformation?

1) Positive delta sum
2) Negative delta sum

sc.GetStudyProfileInformation
Date Time Of Last Edit: 2023-07-02 13:54:51
[2023-07-02 04:34:25]
ertrader - Posts: 672
Nevermind. I coded this myself.
[2023-07-02 07:14:35]
Sierra_Chart Engineering - Posts: 17198
Ok.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-07-02 13:42:18]
ertrader - Posts: 672
Here is the study. It works and returns correct values. However, it's performance is about 70-100ms on an NQ chart with a 60 minute VbP study applied.

Do you have any suggestions on ways to improve performance?

PositiveDeltaSum and NegativeDeltaSum are not available within the GetStudyProfileInformation function so they have to be summed from:
sc.GetVolumeAtPriceDataForStudyProfile()


#include "sierrachart.h"

SCDLLName("VatPriceDataV3")
SCSFExport scsf_VatPriceDataV3(SCStudyInterfaceRef sc)
{
  SCSubgraphRef PositiveDeltaSum      = sc.Subgraph[0];  
  SCSubgraphRef NegativeDeltaSum      = sc.Subgraph[1];  

  SCInputRef INStudyID           = sc.Input[0];


  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "VbP Delta Sum V3";

    sc.AutoLoop = true;
    sc.GraphRegion = 1;

    INStudyID.Name="Study ID";
    INStudyID.SetInt(0);
    INStudyID.SetIntLimits(0,10000);  

    PositiveDeltaSum.Name = "Positive Delta Sum";
    PositiveDeltaSum.DrawStyle = DRAWSTYLE_IGNORE;
    PositiveDeltaSum.LineWidth = 2;    

    NegativeDeltaSum.Name = "Negative Delta Sum";
    NegativeDeltaSum.DrawStyle = DRAWSTYLE_IGNORE;
    NegativeDeltaSum.LineWidth = 2;      

    return;
  }
  
  const int StudyID             = INStudyID.GetInt();
  int PricesCount = sc.GetNumPriceLevelsForStudyProfile(StudyID, 0);

  int PositiveDeltaSumValue, NegativeDeltaSumValue;

  SCFloatArrayRef BidVolume      = sc.Subgraph[1].Arrays[0];  
  SCFloatArrayRef AskVolume      = sc.Subgraph[1].Arrays[1];    
  SCFloatArrayRef AskBidDelta      = sc.Subgraph[1].Arrays[2];      

  for (int PriceIndex = 0; PriceIndex < PricesCount; PriceIndex++)
  {

    s_VolumeAtPriceV2 VolumeAtPrice;

    int Result = sc.GetVolumeAtPriceDataForStudyProfile
    (StudyID
      , 0
      , PriceIndex
      , VolumeAtPrice
    );
    
    if(PriceIndex ==0)
    {
      PositiveDeltaSumValue = 0;
      NegativeDeltaSumValue = 0;
    }      

    BidVolume[PriceIndex] = VolumeAtPrice.BidVolume;
    AskVolume[PriceIndex] = VolumeAtPrice.AskVolume;  
    AskBidDelta[PriceIndex] = AskVolume[PriceIndex] - BidVolume[PriceIndex];
    
    if(AskBidDelta[PriceIndex]>0) PositiveDeltaSumValue = PositiveDeltaSumValue + AskBidDelta[PriceIndex];
    else NegativeDeltaSumValue = NegativeDeltaSumValue + AskBidDelta[PriceIndex];    

  }

    PositiveDeltaSum[sc.Index] = PositiveDeltaSumValue;
    NegativeDeltaSum[sc.Index] = NegativeDeltaSumValue;  
}

Date Time Of Last Edit: 2023-07-04 17:15:39
[2023-07-06 00:41:38]
ertrader - Posts: 672
Do you have any suggestions on ways to improve performance? If not, could this be added to sc.GetStudyProfileInformation?
[2023-07-06 01:34:26]
ForgivingComputers.com - Posts: 960
If you don't care about previous bars, then this should speed things up:

if (sc.Index < sc.ArraySize)
return;

[2023-07-06 15:41:12]
ertrader - Posts: 672
Great.. thank you! That took about 10ms off so definitely in the right direction.

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

Login

Login Page - Create Account