Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 11:47:03 +0000



IsCustomChart = 1

View Count: 2346

[2015-02-07 20:25:34]
QnReally - Posts: 181
I was testing the example shown below to learn how it works.

http://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scIsCustomChart

I started with the scsf_CopyOfBaseGraph(). One modification I did is, I subtracted 10.00 from each of the OHLC values. The new custom bars shifted down by 10.00 correctly. I then added a Volume By Price study to this. The profile is displaying at the original values rather than at 10.00 points below. Here is the visual:
http://www.sierrachart.com/image.php?l=1423340808828.png


Can you please confirm or look into this?

Thanks.
Date Time Of Last Edit: 2015-02-07 20:27:33
[2015-02-08 00:56:36]
Kiwi - Posts: 375
I tend to carefully make sure that my studies are based on the function they're using.

What happens if you change VbP to be based on your new function. Any change?

http://i.imgur.com/MzjXKIv.png
[2015-02-08 01:14:27]
QnReally - Posts: 181
No change Kiwi. The Profile remains 10 points higher.

I have also tried the following:
1) Set Display As Main Price Graph on a custom study that has OHLC, Volume, Number of Trades, Bid Volume, Ask Volume subgraphs all set. The VBP still picks up the base graph data which is now been overridden.

2) I used the Study/Price Overlay study and tried the Display As Main Price Graph option to overlay ES main graph over the NQ chart. The VBP draws the profile at NQ prices.

Thanks for looking into this and I welcome any other pointers.
Date Time Of Last Edit: 2015-02-08 01:22:09
[2015-02-08 01:23:52]
QnReally - Posts: 181
SCSFExport scsf_BaseGraphDisplacement(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Open = sc.Subgraph[0];
  SCSubgraphRef High = sc.Subgraph[1];
  SCSubgraphRef Low = sc.Subgraph[2];
  SCSubgraphRef Last = sc.Subgraph[3];
  SCSubgraphRef Volume = sc.Subgraph[4];
  SCSubgraphRef OpenInterest = sc.Subgraph[5];
  SCSubgraphRef OHLCAvg = sc.Subgraph[6];
  SCSubgraphRef HLCAvg = sc.Subgraph[7];
  SCSubgraphRef HLAvg = sc.Subgraph[8];
  //SCSubgraphRef BidVol = sc.Subgraph[9];
  //  SCSubgraphRef AskVol = sc.Subgraph[10];
  SCInputRef GraphDisplacement = sc.Input[0];

  // Set configuration variables

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

    sc.GraphName = "BaseGraph Displacement Example";

    sc.StudyDescription = "This is an example of how to create a custom chart. This one is a copy of the BaseGraph.";

    // This member indicates that this is a custom chart study.
    //  This can only be set when SetDefaults is true.
    sc.IsCustomChart = 1; // true    
    sc.GraphRegion = 0; // First region    
    sc.DrawZeros = 0; // false    
    sc.GraphDrawType = GDT_OHLCBAR;
    sc.StandardChartHeader = 1; // true

    // Subgraphs

    Open.Name = "Open";
    Open.DrawStyle = DRAWSTYLE_LINE;

    High.Name = "High";
    High.DrawStyle = DRAWSTYLE_LINE;

    Low.Name = "Low";
    Low.DrawStyle = DRAWSTYLE_LINE;

    Last.Name = "Last";
    Last.DrawStyle = DRAWSTYLE_LINE;

    Volume.Name = "Volume";
    Volume.DrawStyle = DRAWSTYLE_IGNORE;

    OpenInterest.Name = "# of Trades / OI";
    OpenInterest.DrawStyle = DRAWSTYLE_IGNORE;

    OHLCAvg.Name = "OHLC Avg";
    OHLCAvg.DrawStyle = DRAWSTYLE_IGNORE;

    HLCAvg.Name = "HLC Avg";
    HLCAvg.DrawStyle = DRAWSTYLE_IGNORE;

    HLAvg.Name = "HL Avg";
    HLAvg.DrawStyle = DRAWSTYLE_IGNORE;

    /*  BidVol.Name = "Bid Vol";
    BidVol.DrawStyle = DRAWSTYLE_IGNORE;

    AskVol.Name = "Ask Vol";
    AskVol.DrawStyle = DRAWSTYLE_IGNORE;*/

    GraphDisplacement.Name = "Diplacement Amount";
    GraphDisplacement.SetDescription("The amount to add to the base graph values. This can be positive or negative.");
    GraphDisplacement.SetFloat(0.0f);
    GraphDisplacement.SetFloatLimits(-10000.0f, 10000.0f);

    return;
  }

  // If our start index is zero, then we want to clear our existing chart
  // data, if any, so we start clean to avoid any possible problems. This
  // is accomplished by using sc.ResizeArrays.
  if (sc.UpdateStartIndex == 0)
  {
    sc.ResizeArrays(0);
  }

  // Do data processing
  for (int i = sc.UpdateStartIndex; i < sc.ArraySize; i++)
  {
    if (sc.OutArraySize - 1 < i)
      sc.AddElements(1);

    sc.DateTimeOut[i] = sc.BaseDateTimeIn[i];

    for (int SubGraph = 0; SubGraph <= 8; SubGraph++)
    {
      if (SubGraph >= 0 && SubGraph <= 3)
        sc.Subgraph[SubGraph][i] = sc.BaseDataIn[SubGraph][i] + GraphDisplacement.GetFloat();
      else
        sc.Subgraph[SubGraph][i] = sc.BaseDataIn[SubGraph][i];

      //For testing coloring bars
      //sc.Subgraph[SubGraph].DataColor[i] = RGB(255,255,255);
    }
  }
}

[2015-02-08 09:26:24]
Sierra Chart Engineering - Posts: 104368
Volume at Price data will not be affected by custom charts.
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

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

Login

Login Page - Create Account