Bullet Function

SYNTAX:  Bullet(Index: integer, Position: integer [, Color: integer]): integer;

DESCRIPTION:  The  Bullet  function will draw a bullet marker on a chart (a small square marker).  The  Bullet  function returns the color of the chart pixel at the proposed bullet location.  The return value can be used to test for the presence of an existing bullet at that location.  The return value will be 0 zero if the pixel color is the same as the chart background color.  A bullet will not be drawn when the  Color  parameter is omitted.  Use  'eNone'  as the  Color  parameter to erase or remove an existing bullet.  NOTE:  Bullets are not permanent draw objects to a chart.  A bullet is a temporary drawing, that will be lost if the chart is refreshed, moved, or redrawn.

PARAMETERS:

Index:      Index is the bar array subscript between 1 and the number of bars on the chart.

Position:  Position is one of the following  predefined constants, which specify the location of the bullet:

      eHigh        - places bullet above the High of the bar
      eLast        - places bullet on the Last price of the bar
      eLow         - places bullet below the Low of the bar
      eMidPoint  - places bullet on the Midpoint of the bar  (H + L) / 2
      eOpen       - places bullet on the Open price of the bar
      1      - places bullet on the very top row of the chart
      2      - places bullet on the 2nd top row of the chart
      3      - places bullet on the 3rd top row of the chart
      4      - places bullet on the 1st bottom row of the chart
      5      - places bullet on the 2nd bottom row of the chart
      6      - places bullet on the very bottom row of the chart

Color:    Color may be one of the following numbers, which indicate the bullet color.  These numeric values use the colors that are specified in the chart defaults screen.  Select  SetUp | Chart  from the menu to change the colors.

         0 = Normal color
         1 = Bullish color
         2 = Bearish color
         3 = Big Cross color
         4 = Volume color
         5 = OpenInt color
         6 = Grid color
     254 = background color (hidden) = eNone.
      Setting a bulletís color to  'eNone'  will remove a bullet.

      Color may also be one of the following  predefined constants:

    clAqua       clBlack     clBlue       clBtnFace    clBtnHighLight  
    clBtnShadow  clDkBlue    clDkGray     clDkGreen    clDkRed 
    clFuchsia    clGray      clGreen      clLime       clLtBlue 
    clLtGray     clLtGreen   clLtRed      clMaroon     clNavy   
    clOlive      clOrange    clPurple     clRed        clSilver
    clTeal       clWhite     clYellow

      NOTE:  Since  clBlack  has a value of 0, using it would color the bar with the Normal color instead of black.

EXAMPLE:  The following example places a Red bullet below any bar that has a lower low than the previous bar.  It places a Green bullet above any bar that has a higher high than the previous bar.  It tests to see if a bullet is already in place.  A bullet is not drawn if a bullet already exists in that position.

var                            {Start of Variable declarations}
 i: integer;                   {Declare i as an integer}
begin                          {Start of Main programming code}
 Chart('IBM.D');               {Open an IBM daily chart}
 for i:= BarLeft to BarEnd do  {Loop from left edge of screen to last bar}
 begin                         {Start of programming block for loop}
  if High(i)>High(i-1) then    {If bar has a higher high then draw bullet}
   if Bullet(i,eHigh)=0 then Bullet(i,eHigh,clBlue);
  if Low(i)<Low(i-1) then      {If bar has a lower low then draw bullet}
   if Bullet(i,eLow)=0 then Bullet(i,eLow,clRed);
 end;                          {End of loop programming block}
end;                           {End of program}