Vertical Time Plot indicator anyone?

Questions about MultiCharts and user contributed studies.
jzolty

Vertical Time Plot indicator anyone?

Postby jzolty » 28 Aug 2006

Any body know how to write an indicator to plot a vertical line at a set time of day. The set time adjustable in input: and the plot reoccuring every day...

thanks,
Jack

User avatar
Alex Kramer
Posts: 834
Joined: 23 Feb 2006

Postby Alex Kramer » 28 Aug 2006

Please try this code:

Input : time_in_seconds(120000);
Input : color(red), size(2);

if time_s = time_in_seconds then begin
value1=tl_new_s(date,time_s,l,date,time_s,h);
tl_setcolor(value1,color);
tl_setsize(value1,size);
tl_setextleft(value1,true);
tl_setextright(value1,true);
end;

jzolty

Thanks Alex,.. however indicator didn't plot

Postby jzolty » 29 Aug 2006

Hi Alex, once again thank you for responding...however the indicator didn't show. ... ?? I'm not sure why... the code compiled ok..? just didn't appear on the chart. ?
hope you can help.

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 04 Sep 2006

Dear Jack,

Here is the slightly modified code. You have to specify the time in HHMM format of the closing price of the current bar. For example 1600 if the Time of the bar is 4:00pm or 0930 if the Time of the bar is 9:30am. Please let me know how it works.

Code: Select all

Input : time_(1730);
Input : color(red), size(2);

if time = time_ then begin
value1=tl_new_s(date,time_s,l,date,time_s,h);
tl_setcolor(value1,color);
tl_setsize(value1,size);
tl_setextleft(value1,true);
tl_setextright(value1,true);
end;

jzolty

Time plot

Postby jzolty » 07 Sep 2006

Thank Stanley,
I tried the code however I get a horizontal line.....around the prices...
Basically what I am looking for is a vertical line to be plotted in a future time...
The plot will alert me when lunch trading is about to start or afternoon trading session is about to start..... ie. it gives me a heads up that the time is approaching.... I usually place these vertical lines in in the morning and then forget about them untill they show up at the predetermined time...

I hope to place the indicator once on the chart and it will plot everyday from then on at the predetermined time.
Sure hope you can help,
Jack

Chris
Posts: 150
Joined: 17 Nov 2005

Re: Time plot

Postby Chris » 08 Sep 2006

Thank Stanley,
I tried the code however I get a horizontal line.....around the prices...
Basically what I am looking for is a vertical line to be plotted in a future time...
The plot will alert me when lunch trading is about to start or afternoon trading session is about to start..... ie. it gives me a heads up that the time is approaching.... I usually place these vertical lines in in the morning and then forget about them untill they show up at the predetermined time...

I hope to place the indicator once on the chart and it will plot everyday from then on at the predetermined time.
Sure hope you can help,
Jack
Jack,

I used Stanley's code and I am getting a nice vertical line at my specified time i.e. 4:30 in my example.

Chris

P.S.: I am getting a horizontal line in some case, but this line changes in a vertical line within one tick.
Attachments
vertical_line.png
(51.79 KiB) Downloaded 831 times


Return to “MultiCharts”