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

Re: System name on charts



PureBytes Links

Trading Reference Links

> 
> Date: Thu, 29 Jun 2000 09:51:30 +0200
> From: Massimo Ciarafoni <maxci@xxxxxx>
> To: Gary Fritz <fritz@xxxxxxxx>
> CC: omega list <omega-list@xxxxxxxxxx>
> Subject: Re: System name on charts
> 
> 
> I use something like this to be sure text doesn't interfer with past price action:
> 
> { Indicator:  Chart Label }
> 
> Inputs: Label("Label"),Incr(100),Len(40);
> 
> Vars: TxtObj(0), Hi(0), Lo(0);
> 
> Hi = Highest(H,Len);
> if CurrentBar = 1 then begin
>     TxtObj = Text_New(Date,Time,Close,Label);
>     Text_SetStyle(TxtObj,1,1);  {Left, Above}
>     Text_SetColor(TxtObj,Tool_Yellow);
> end;
> if LastBarOnChart then Text_SetLocation(TxtObj, Date, Time, Hi);
> Plot1(Hi+Incr,"");
> 
> Plot on price data, plot1 color as background,len inputs as long as required by length of
> text, Incr (in the same price units of the market charted) to set so to leave enough room for
> the text to show.


While playing with the Text_New function in TS 4 (build 24), using
Massimo Ciarafoni’s idea of defining the top of the chart with an
invisible plot1(Highest(H,len) + Incr,""), I found TS 4 giving results I
had not before noticed. Namely, that user text could be pushed into the
same level with the status line and not disappear. This is not possible
in TS 2000, with the text only going up to the bottom of the status line
and disappearing if pushed higher, unless plot1(Highest(H,len) +
Incr,"") is used. But in TS 4 it seems only the Highest(H,Len) function
(in conjunction with Text_SetStyle), and not plot1(Highest(H,len) +
Incr,""), is needed to make use of the status line level. 

I posted an indicator on the code-list (1 Sept 1999 12:02) that gave, in
TS 4, the symbol on an EOD chart. But sometimes, with that code, the
symbol was pushed off the chart. The much simpler code below, using the
Highest(H,Len) function, does the same thing as the earlier code and the
symbol always stays on the chart. (This seems too simple to be true. In
the past, I have spent hours coding, trying to get the symbol to always
stay on the chart, but never quite made this combination).

input: len(10);
var: K(""), hi(0);

K=GetSymbolName;

Hi = Highest(H,Len);
if LastBarOnChart then begin		
   Txt = Text_New(D,Time,hi,K);
   Text_SetStyle(Txt,1,1); 
   Text_SetColor(Txt,Tool_red);
end;

if 2=1 then plot1(c,"");	{every indicator in TS 45 needs a plot
statement}