Support Board
Date/Time: Sat, 10 May 2025 05:01:32 +0000
Post From: How to set sc.BaseGraphGraphDrawType?
[2015-10-20 20:28:36] |
DarthSidious - Posts: 63 |
Works great! But it waits for a chart update for the data processing loop to kick in. So is it possible to track user initiated changing of sc.ChartBarSpacing? Just needed to know if there are any existing mechanism. If not, not really asking for it. Perhaps a way to ask the chart to redraw itself from ASCIL? Many thanks! /******************************************************************************* * Change bar type based on bar spacing; if spacing 4 or more, Candle, else HLC ******************************************************************************/ SCSFExport scsf_AutoChangeBarType(SCStudyInterfaceRef sc) { // Study variables ///////////////////////////////////////////////////////// SCInputRef MinBarSpacingForCandleType = sc.Input[0]; if(sc.SetDefaults) { sc.GraphName = "AutoChangeBarType"; sc.StudyDescription = "Change bar type based on bar spacing; if spacing 4 or more, Candle, else HLC"; sc.GraphRegion = 0; #if defined(_DEBUG) sc.FreeDLL = 1; // Set to 1 during development; when done, set to 0 #else sc.FreeDLL = 0; #endif sc.AutoLoop = 1; MinBarSpacingForCandleType.Name = "MinBarSpacingForCandleType"; MinBarSpacingForCandleType.SetInt(4); return; // Must return before doing any data processing if sc.SetDefaults is true } // Data processing ///////////////////////////////////////////////////////// if(sc.Index >= sc.DataStartIndex) { if(sc.ChartBarSpacing >= MinBarSpacingForCandleType.GetInt()) sc.BaseGraphGraphDrawType = GDT_CANDLESTICK; else sc.BaseGraphGraphDrawType = GDT_HLCBAR; } } Date Time Of Last Edit: 2015-10-20 20:29:49
|