[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System name on charts



PureBytes Links

Trading Reference Links

> Is there a way to get TS4 to display the system name on a chart?  

I use the attached indicator to place arbitrary labels on a chart.  I 
don't know any way in EL to get the current system name, but you 
could manually apply the indicator with the correct system name.

The trouble I had was placing the text on the chart.  I wanted it to 
stay near the right side of the chart, so I had to place it 
explicitly in the code.  As far as I know, there is no way to find 
the current max & min price displayed on a chart, so I fudged by 
looking at the max/min price in the last 200 bars.  This doesn't 
always work very well, but usually it works "well enough."

If somebody has a better answer, I'd like to see it.
Gary



{ Indicator:  Chart Label }

Inputs: Label("Label");

Vars: TxtObj(0), Hi(0), Lo(0);

if CurrentBar = 1 then begin
  TxtObj = Text_New(Date,Time,Close,Label);
  Text_SetStyle(TxtObj,1,2);  {Left, Centered}
  Text_SetColor(TxtObj,Tool_Yellow);
  end;

if LastBarOnChart then begin
  Hi = Highest(H,200);
  Lo = Lowest(L,200);
  if (C-Lo)/(Hi-Lo) > 0.5 
    then Text_SetLocation(TxtObj, Date, Time, Lo+(Hi-Lo)/10)
    else Text_SetLocation(TxtObj, Date, Time, Hi-(Hi-Lo)/10);
  end;

if False then plot1(0,"");