Login Page - Create Account

Support Board


Date/Time: Sun, 12 Jan 2025 09:32:46 +0000



How to set condition to trigger email?

View Count: 2623

[2016-10-10 17:34:24]
Sierra Chart Engineering - Posts: 104368
We still have not gotten to this yet. It is on our near-term to do list.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-12 11:04:25]
User701247 - Posts: 117
If you can find any sample on how to retrieve the value based on different levels, that should be enough for me to understand the programming structures. Once I know on what variable and structure to be used, I should able to handle the rest of coding.

Do you have any suggestions?
Thank you very much for any suggestions :>
[2016-10-18 01:35:35]
Sierra Chart Engineering - Posts: 104368
Just give us about another day.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-18 15:48:46]
User701247 - Posts: 117
I look forward to your good news.
Thank you very much for any suggestions :>
[2016-10-23 09:53:38]
Sierra Chart Engineering - Posts: 104368
We finally have a good example for you. We created a new study in Sierra Chart called "Volume at Price Threshold Alert V2".

Below is the source code for it.

If you can find any sample on how to retrieve the value based on different levels, that should be enough for me to understand the programming structures. Once I know on what variable and structure to be used, I should able to handle the rest of coding.

This should be a big help for what you want to do.


SCSFExport scsf_VolumeAtPriceThresholdAlertV2(SCStudyInterfaceRef sc)
{
  SCInputRef ComparisonMethod = sc.Input[0];
  SCInputRef VolumeThreshold = sc.Input[1];
  SCInputRef AlertNumber = sc.Input[2];

  if (sc.SetDefaults)
  {
    // Set the configuration and defaults
    sc.GraphName = "Volume At Price Threshold Alert V2";

    sc.GraphRegion = 0;    
    sc.AutoLoop = 0;//Manual looping
    sc.ValueFormat = sc.BaseGraphValueFormat;

    sc.FreeDLL = 0;

    sc.MaintainVolumeAtPriceData = 1; // true

    
    for (int SubgraphIndex = 0; SubgraphIndex < SC_SUBGRAPHS_AVAILABLE; ++SubgraphIndex)
    {
      SCString SubgraphName;
      SubgraphName.Format("Trigger %d", SubgraphIndex);

      sc.Subgraph[SubgraphIndex].Name = SubgraphName;
      sc.Subgraph[SubgraphIndex].PrimaryColor = RGB(255, 128, 0);
      sc.Subgraph[SubgraphIndex].DrawStyle = DRAWSTYLE_SQUARE_OFFSET_LEFT_BODY;
      sc.Subgraph[SubgraphIndex].LineWidth = 8;
      sc.Subgraph[SubgraphIndex].DrawZeros = 0;
    }


    ComparisonMethod.Name = "Comparison Method";
    ComparisonMethod.SetCustomInputStrings("Bid Volume;Ask Volume;Total Volume;Number of Trades;Ask Volume Bid Volume Difference;");
    ComparisonMethod.SetCustomInputIndex(2);

    VolumeThreshold.Name = "Volume Threshold";
    VolumeThreshold.SetInt(100);

    AlertNumber.Name = "Volume Alert Number";
    AlertNumber.SetAlertSoundNumber(0);
    
    sc.ValueFormat = VALUEFORMAT_INHERITED;

    return;
  }
      
  //This is an indication that the volume at price data does not exist
  if ((int)sc.VolumeAtPriceForBars->GetNumberOfBars() < sc.ArraySize)
    return;

  SCString AlertMessage;
  bool EnableAlerts = sc.IsFullRecalculation == 0 && !sc.DownloadingHistoricalData;

  for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++)
  {
    int AvailableSubgraphIndex = 0;

    //Reset all subgraph values
    for (int SubgraphIndex = 0; SubgraphIndex < SC_SUBGRAPHS_AVAILABLE; ++SubgraphIndex)
      sc.Subgraph[SubgraphIndex].Data[BarIndex] = 0;


    s_VolumeAtPriceV2 *p_VolumeAtPrice = NULL;
    int NumberOfPricesAtBarIndex = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(BarIndex);

    for (int PriceIndex = 0; PriceIndex < NumberOfPricesAtBarIndex; ++PriceIndex)
    {
      if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(BarIndex, PriceIndex, &p_VolumeAtPrice))
        continue;

      float Price = p_VolumeAtPrice->PriceInTicks * sc.TickSize;

      // Check if condition has been met
      //Bid Volume;Ask Volume;Total Volume;Number of Trades;Ask Volume Bid Volume Difference;
      int ComparisonMethodIndex = ComparisonMethod.GetIndex();
      bool ConditionMet = false;
      unsigned int VolumeThresholdValue = VolumeThreshold.GetInt();

      if (ComparisonMethodIndex == 0)
      {
        if (p_VolumeAtPrice->BidVolume >= VolumeThresholdValue)
          ConditionMet = true;

      }
      else if (ComparisonMethodIndex == 1)
      {
        if (p_VolumeAtPrice->AskVolume >= VolumeThresholdValue)
          ConditionMet = true;
      }
      else if (ComparisonMethodIndex == 2)
      {
        if (p_VolumeAtPrice->Volume >= VolumeThresholdValue)
          ConditionMet = true;
      }
      else if (ComparisonMethodIndex == 3)
      {
        if (p_VolumeAtPrice->NumberOfTrades >= VolumeThresholdValue)
          ConditionMet = true;
      }
      else if (ComparisonMethodIndex == 4)
      {
        int AskVolumeBidVolumeDifference = p_VolumeAtPrice->AskVolume - p_VolumeAtPrice->BidVolume;
        int VolumeThresholdSigned = VolumeThreshold.GetInt();

        if (AskVolumeBidVolumeDifference > 0 && VolumeThresholdSigned > 0 && AskVolumeBidVolumeDifference >= VolumeThresholdSigned)
          ConditionMet = true;
        else if (AskVolumeBidVolumeDifference < 0 && VolumeThresholdSigned < 0 && AskVolumeBidVolumeDifference <= VolumeThresholdSigned)
          ConditionMet = true;

      }

      if (ConditionMet )
      {
        sc.Subgraph[AvailableSubgraphIndex][BarIndex] = Price;

        if (AvailableSubgraphIndex < SC_SUBGRAPHS_AVAILABLE - 1)
          ++AvailableSubgraphIndex;

        if (EnableAlerts && AlertNumber.GetAlertSoundNumber() > 0 && BarIndex == sc.ArraySize - 1)
        {

          sc.SetAlert(AlertNumber.GetAlertSoundNumber() - 1 , "Volume threshold triggered");
        }
      }
    }
  }
}

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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-10-23 10:03:48
[2016-10-23 10:07:44]
Sierra Chart Engineering - Posts: 104368
We made a small change to the code above. Reload this page for the current content.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-23 13:31:08]
User701247 - Posts: 117
I would look into those code :>

Thanks you very very much for your time and suggestions.
[2016-10-23 22:16:43]
Sierra Chart Engineering - Posts: 104368
OK just let us know if you need more help.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-01-27 06:30:40]
User701247 - Posts: 117
Referring to attached image and given sample, I would like to know on how to define following variables as shown below:

//Bid Volume;Ask Volume;Total Volume;Number of Trades;Ask Volume Bid Volume Difference; Diagonal Ask Volume Bid Volume Difference;

int Ask_Bid_Vol_Different = Would following code comparing the Ask and Bid vol difference on same level?
if (ComparisonMethodIndex == 4)
{
int AskVolumeBidVolumeDifference = p_VolumeAtPrice->AskVolume - p_VolumeAtPrice->BidVolume;
int VolumeThresholdSigned = VolumeThreshold.GetInt();

if (AskVolumeBidVolumeDifference > 0 && VolumeThresholdSigned > 0 && AskVolumeBidVolumeDifference >= VolumeThresholdSigned)
ConditionMet = true;
else if (AskVolumeBidVolumeDifference < 0 && VolumeThresholdSigned < 0 && AskVolumeBidVolumeDifference <= VolumeThresholdSigned)
ConditionMet = true;
}

int Ask_Bid_Vol_Different_Diagonal = What about the coding comparing the Ask and Bid vol difference on Diagonal level?

if (ComparisonMethodIndex == 5)
{

Since the reference document is not available yet, do you have any suggestions on what variable should be used for retrieving AskVolume and BidVolume at Diagonal level?
int AskVolumeBidVolumeDifferenceDiagonal = p_VolumeAtPrice->? - p_VolumeAtPrice->?;
}

Furthermore, I would like to search for any variable's description, is there any search feature under sierrachart.com? so I can easily to read the description on any variables.

Table of Contents | (Advanced Custom Study/System Interface and Language (ACSIL))

Do you have any suggestions?
Thank you very much for any suggestions :>
Date Time Of Last Edit: 2017-01-27 06:54:17
imageCounting.JPG / V - Attached On 2017-01-27 06:23:08 UTC - Size: 93.19 KB - 361 views
[2017-01-27 17:42:27]
Sierra Chart Engineering - Posts: 104368
This is a programming question and is outside the scope of our software.

At the top right of all webpages is a search box you can use to search for text in the documentation.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-01-28 00:50:39]
User701247 - Posts: 117
(Q1)
Referring to following reply, since the member functions for sc.VolumeAtPriceForBars are not currently documented and I need to work on study related to sc.VolumeAtPriceForBars. Would your team be possible to work on and update VolumeAtPriceForBars documented Descriptions for all available Member Function? so I can find reference for any related member functions for developing studies.

Reply from another post:
The member functions for sc.VolumeAtPriceForBars are not currently documented but we will gradually work on those. We will start with this one.

We have updated the documentation here including the answer to your other question:
ACSIL Interface Members - Variables and Arrays: sc.VolumeAtPriceForBars

(Q2)
On the other hands, when I search google, I cannot find any related following keywords at all, do you have any related reference materials for this issues? and what does it represent?

p_NextVolumeAtPrice->AskVolume
p_VolumeAtPrice->BidVolume

(Q3)
Furthermore, please see the attached image, when I do search on search input box, the search engine seems not working at this moment.

Do you have any suggestions?
Thank you very much for any suggestions :>
Date Time Of Last Edit: 2017-01-28 03:35:43
imageVolumeThresholdValue.png / V - Attached On 2017-01-28 00:48:29 UTC - Size: 42.78 KB - 322 views

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

Login

Login Page - Create Account