1st Q:

colorbar = iif(barindex() == barcount - 1 - 180, colorred, colorwhite);
plot(c, "", colorbar, stylebar);

2nd Q:

Use the same approach.  colorbar = iif(datenum() == XXXX, colorred, colorwhite);

Bill
  ----- Original Message ----- 
  From: wavetrader2005 
  To: [email protected] 
  Sent: Thursday, June 19, 2008 5:16 PM
  Subject: [amibroker] COLORING A SPECIFIC BAR


  Can someone help with the code to color a specific bar with a 
  selected color?

  First, I'd like to be able to color a bar that is "x" bars from the 
  last bar on the chart; for e.g., color the bar that is "180" bars 
  from that last bar.  I'd like this indicator to work on monthly, 
  weekly and daily charts, with the indicator recognizing each of these 
  chart compressions and coloring the bar accordingly.

  Second, I'd like to be able to color a bar on a specific date; for 
  e.g., color a bar on May 31, 2008.

  In the first case, as new data is added to the chart the bar that is 
  colored would remain at 180 bars from the last bar; in other words, 
  the colored bar would always be a fixed number of bars from that last 
  bar.

  The indicator would have two inputs, "BarsBack" and "BarDate", with 
  the "BarsBack" being the default and "BarDate" containing a null 
  value.  When a date is entered it would override the "BarsBack" 
  setting and color the bar on that specific date.

  Can anyone help with this?

  Thanks,

  Wave~Trader


  ------------------------------------

  Please note that this group is for discussion between users only.

  To get support from AmiBroker please send an e-mail directly to 
  SUPPORT {at} amibroker.com

  For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
  http://www.amibroker.com/devlog/

  For other support material please check also:
  http://www.amibroker.com/support.html
  Yahoo! Groups Links





------------------------------------------------------------------------------



  No virus found in this incoming message.
  Checked by AVG. 
  Version: 8.0.100 / Virus Database: 270.4.0/1509 - Release Date: 6/19/2008 
8:00 AM

Reply via email to