Font font = new Font("Arial", 7, FontStyle.Regular); SetScaleCompressed(15); DataSeries CompBar = new DataSeries(Bars, "Compressed Bar Numbers"); // initialize a DataSeries for (int bar = 0; bar < Bars.Count; bar++) // load the bar numbers CompBar[bar] = bar; DataSeries CompressedClose = Close; // Compressed series for test RestoreScale(); // Synch the bar numbers with the base time frame (here's your "function") DataSeries GetIntradayBar = Synchronize(CompBar); for(int bar = 0; bar < Bars.Count; bar++) { int b = (int)GetIntradayBar[bar]; AnnotateBar(b.ToString("0"), bar, true, Color.Black, Color.Transparent, font); AnnotateBar(CompressedClose[b].ToString("0.00"), bar, false, Color.Black, Color.Transparent, font); }
// Workaround for GetWeeklyBarSetScaleWeekly(); DataSeries CompBar = new DataSeries(Bars, "Compressed Bar Numbers"); // initialize a DataSeries for (int bar = 0; bar < Bars.Count; bar++) CompBar[bar] = bar;// Weekly EMA DataSeries wk_ema = EMA.Series( Bars.Close, 10, EMACalculation.Modern );RestoreScale();DataSeries wk_ema_synchedToIntraday = Synchronize( wk_ema ); DataSeries GetWeeklyBar = Synchronize(CompBar);PlotSeries( PricePane, wk_ema_synchedToIntraday, Color.Blue, LineStyle.Solid, 1 ); SetBarColors( Color.Silver, Color.Silver ); HideVolume(); Font font = new Font("Courier", 7, FontStyle.Regular);for(int bar = 30; bar < Bars.Count; bar++) { int gwb = (int)GetWeeklyBar[bar]; AnnotateBar(gwb.ToString(), bar, false, Color.Black,Color.Transparent, font); if( wk_ema[gwb] > wk_ema[gwb-1] ) SetBarColor( bar, Color.Blue ); }