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

Re: High and Low Displayed on Chart



PureBytes Links

Trading Reference Links

At 10:53 AM 9/8/2004, Joe wrote:

>Is there a way to write the high and low of the current bar to the screen
>and have it update in real-time in TS2ki?  The data window would be fine,
>but it doesn't update in real-time.  When I use "chart options" to display
>the high and low I get the high and low of the day, not the 3 minute bar I'm
>looking at.
>
>Any suggestions would be greatly appreciated.

The code below will draw the values on the screen. 

If you set the indicator to "Update value intra-bar" it will run the code each time there is a new value and thus update in real time.

Bob Fulks

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

Var: Init(TRUE), Txt1(0), Txt2(0);

if LastBarOnChart then begin
   if Init then begin
      Init = FALSE;
      Txt1 = Text_New(Date, Time, High, "H = " + NumToStr(High, 2));
      Txt2 = Text_New(Date, Time, Low, "L = " + NumToStr(Low, 2));
      Text_SetStyle(Txt1, 1, 1);
      Text_SetStyle(Txt2, 1, 3);
   end else begin
      Text_SetLocation(Txt1, Date, Time, High);
      Text_SetString(Txt1, "H = " + NumToStr(High, 2));
      Text_SetLocation(Txt2, Date, Time, Low);
      Text_SetString(Txt2, "L = " + NumToStr(Low, 2));
   end;
end;