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
Vertical Time Plot indicator anyone?
- Alex Kramer
- Posts: 834
- Joined: Feb 23 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;
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;
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.
hope you can help.
- Stanley Miller
- Posts: 556
- Joined: Jul 26 2005
- Has thanked: 3 times
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.
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;
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
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,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
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