/*==========================================================================*/ SCSFExport scsf_NumericInformationGraphDrawTypeExample(SCStudyInterfaceRef sc) { SCSubgraphRef Grid = sc.Subgraph[0]; SCSubgraphRef Open = sc.Subgraph[1]; SCSubgraphRef High = sc.Subgraph[2]; SCSubgraphRef Low = sc.Subgraph[3]; SCSubgraphRef Close = sc.Subgraph[4]; SCSubgraphRef Volume = sc.Subgraph[5]; SCInputRef FontSize = sc.Input[0]; if (sc.SetDefaults) { // Set the configuration and defaults sc.GraphName = "Numeric Information Graph Draw Type Example"; sc.StudyDescription = "Numeric Information Graph Draw Type Example"; sc.AutoLoop = true; sc.FreeDLL = 0; sc.GraphDrawType = GDT_NUMERIC_INFORMATION; FontSize.Name = "Font Size"; FontSize.SetInt(8); FontSize.SetIntLimits(0,100); Grid.Name = "Grid Style"; Grid.DrawStyle = DRAWSTYLE_LINE; Grid.PrimaryColor = COLOR_GRAY; Open.Name = "Open"; Open.DrawStyle = DRAWSTYLE_LINE; Open.PrimaryColor = COLOR_CYAN; High.Name = "High"; High.DrawStyle = DRAWSTYLE_LINE; High.PrimaryColor = COLOR_GREEN; Low.Name = "Low"; Low.DrawStyle = DRAWSTYLE_LINE; Low.PrimaryColor = COLOR_RED; Close.Name = "Close"; Close.DrawStyle = DRAWSTYLE_LINE; Close.PrimaryColor = COLOR_PURPLE; Volume.Name = "Volume"; Volume.DrawStyle = DRAWSTYLE_LINE; Volume.PrimaryColor = COLOR_WHITE; return; } if (sc.Index == 0) { sc.ValueFormat = sc.BaseGraphValueFormat; // set up the information graph draw type s_NumericInformationGraphDrawTypeConfig NumericInformationGraphDrawTypeConfig; // only need to override defaults (see s_NumericInformationGraphDrawTypeConfig for defaults and other options to override) NumericInformationGraphDrawTypeConfig.GridlineStyleSubgraphIndex = 0; // allow sg 1 to specify grid line style NumericInformationGraphDrawTypeConfig.FontSize = FontSize.GetInt(); NumericInformationGraphDrawTypeConfig.ValueFormat[5] = 0; // set value format for volume, others are inherited sc.SetNumericInformationGraphDrawTypeConfig(NumericInformationGraphDrawTypeConfig); // display volume first sc.SetNumericInformationDisplayOrderFromString("6,2,3,4,5"); } // Do data processing Open[sc.Index] = sc.Open[sc.Index]; High[sc.Index] = sc.High[sc.Index]; Low[sc.Index] = sc.Low[sc.Index]; Close[sc.Index] = sc.Close[sc.Index]; Volume[sc.Index] = sc.Volume[sc.Index]; // set cell foreground/background color if (Close[sc.Index] > Close[sc.Index-1]) Close.DataColor[sc.Index] = sc.CombinedForegroundBackgroundColorRef(COLOR_BLACK, COLOR_GREEN); else Close.DataColor[sc.Index] = sc.CombinedForegroundBackgroundColorRef(COLOR_WHITE, COLOR_RED); }