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 CompBarbar = 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)GetIntradayBarbar; AnnotateBar(b.ToString("0"), bar, true, Color.Black, Color.Transparent, font); AnnotateBar(CompressedCloseb.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++) CompBarbar = 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)GetWeeklyBarbar; AnnotateBar(gwb.ToString(), bar, false, Color.Black,Color.Transparent, font); if( wk_emagwb > wk_emagwb-1 ) SetBarColor( bar, Color.Blue ); }