Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 00:29:03 +0000



Post From: Volume by Price - Valleys and Peak data not on spreadsheet

[2020-10-30 16:26:26]
BreadWinner'sAssoc. - Posts: 7
I've been trying to use this as well. The first Peak Valley lines shows on my chart, but I don't know how to get the peak valley values into an array that I can in order to use a for loop to index through them. I haven't had any luck using a for loop. I've added the code I've used which got a peak valley line to draw on my chart. SC Support, I apologize for asking such a trivial question, but I have gone through the documentation and example study code. I'm probably overlooking a simple solution. Any guidance would be very much appreciated!

    sc.AutoLoop = 0;

    sc.Input[0].SetStudyID(1);
    sc.Input[0].Name = "Peak Valley Test";
    sc.Subgraph[0].Name = "Line1";
    sc.Subgraph[0].PrimaryColor = RGB(0, 255, 0);
    sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
    sc.Subgraph[1].Name = "Line2";
    sc.Subgraph[1].PrimaryColor = RGB(255, 255, 0);
    sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;

    return;
  }


  float PeakValleyLinePrice = 0;
  int PeakValleyType = 0;
  int StartIndex = 0;
  int PeakValleyExtensionChartColumnEndIndex = 0;

  if (sc.GetStudyPeakValleyLine(sc.ChartNumber, sc.Input[0].GetStudyID(), PeakValleyLinePrice, PeakValleyType, StartIndex, PeakValleyExtensionChartColumnEndIndex, -1, 0))
  {

    sc.Subgraph[0][sc.Index] = sc.GetStudyPeakValleyLine(sc.ChartNumber, sc.Input[0].GetStudyID(), PeakValleyLinePrice, PeakValleyType, StartIndex, PeakValleyExtensionChartColumnEndIndex, -1, 0);
  }
  sc.Subgraph[1][sc.Index] = PeakValleyLinePrice;