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

Re: EL Code Stumper



PureBytes Links

Trading Reference Links

At 2:03 PM -0600 3/10/98, Patrick M wrote:
>
>
>Dear EL Programmers,
>
>I am trying to output text to the screen based on the current value of a
>variable or input.  If you look at the "CandleStick Pattern" indicator
>which comes with TS 4.0 you can see that it puts hard coded text on the
>price chart when a pattern is identified.  I need to output the same type
>of text but I need the text to reflect the current value of a variable or
>input.  Is this possible?
>
> 


Attached is code that does something similar to what you required. It is a
part of some other code so may not verify as it stands. Please consider it
as an example of what is required.

To convert the value of a numeric variable to a string variable (like the
variable "Str" below), you need to use the "NumToStr" function.

Hope this helps.

Bob Fulks



Vars:  X(FALSE),      {In X column when true, O when false}
       Display(FALSE),{Enables display on this bar}
       StOffset(0),   {Offset to start plotting line under title}
       Str(""),       {String variable to plot text}
       DLine(0),      {Date line value to plot text}
       VLevel(0),     {Vertical level to plot text}
       VOffset(3),    {Vertical offset for text above bars}
       Rng(0),        {Range}

Display = TRUE;
StOffset = 2;
Str = "XXX";

{Display text and line under text}

if Display then begin
  VLevel = Highest(H, StOffset + 1) + VOffset;
  Value4 = StOffset/2;
  DLine  = iff(Mod(StOffset, 2) = 0, 2, 0);

  Value1 = Text_New(Date[Value4],Time[Value4], VLevel, Str);
  Value2 = Text_SetStyle(Value1,DLine,2);
  Value2 = Text_SetColor(Value1,Tool_Yellow);

  Value3 = TL_New(Date[StOffset],Time[StOffset], VLevel, Date, Time, VLevel);
  Value2 = TL_SetColor(Value3, Tool_Yellow);
  Value2 = TL_SetExtLeft(Value3, FALSE);
  Value2 = TL_SetExtRight(Value3, FALSE);
  Value2 = TL_SetAlert(Value3,0);
end;