Trading Articles
Article Categories
Article Tools
Vertical Line every 30 min.
Updated September 26, 2022
Top Posters
looks_one
JoeDee
with 1 posts (2 thanks)
looks_two
Carlera
with 1 posts (0 thanks)
looks_3
SunTrader
with 1 posts (3 thanks)
looks_4
eskules
with 1 posts (0 thanks)
trending_up
1,837 views
thumb_up
5 thanks given
group
5 followers
forum
2 posts
attach_file
1 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Vertical Line every 30 min.
(login for full post details)
#1 (permalink )
Colombia
Posts: 8 since Mar 2021
Thanks: 1 given,
1
received
Hi, I am trying to code a indicator than show a vertical line every 30 min, Can from 09:00 hrs to 16:00 hrs, I have gratefully.
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Boca Raton, FL
Posts: 230 since Nov 2018
Thanks: 70 given,
164
received
Carlera
Hi, I am trying to code a indicator than show a vertical line every 30 min, Can from 09:00 hrs to 16:00 hrs, I have gratefully.
There is very likely a cleaner, shorter way of coding but this is what I have:-
Code
Inputs: String LineColor ("Red"), LineTime1(0900), LineTime2(0930), LineTime3(1000), LineTime4 (1030), LineTime5 (1100),
LineTime6 (1130), LineTime7 (1200), LineTime8 (1230), LineTime9 (1300), LineTime10 (1330), LineTime11 (1400), LineTime12 (1430), LineTime13 (1500), LineTime14 (1530),
LineTime15 (1600);
Using elsystem.drawingobjects;
Using elsystem.drawing;
Variables: VerticalLine VL(null);
Method void DrawVerticalLine() begin
VL = VerticalLine.Create(DTPoint.Create(BarDateTime,0));
VL.Persist = False;
DrawingObjects.Add(VL);
End;
If T >= LineTime1 and T[1] < LineTime1 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime2 and T[1] < LineTime2 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime3 and T[1] < LineTime3 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime4 and T[1] < LineTime4 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime5 and T[1] < LineTime5 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime6 and T[1] < LineTime6 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime7 and T[1] < LineTime7 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime8 and T[1] < LineTime8 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime9 and T[1] < LineTime9 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime10 and T[1] < LineTime10 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime11 and T[1] < LineTime11 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime12 and T[1] < LineTime12 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime13 and T[1] < LineTime13 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime14 and T[1] < LineTime14 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
If T >= LineTime15 and T[1] < LineTime15 then begin
DrawVerticalLine();
VL.Color = Color.FromName(LineColor);
VL.Style = StyleType.Dashed;
VL.Weight = 0;
End;
Copy code into a new EayLanguage Document window, give it a name, verify it and then remember to go into Properties ---> Scaling tab and select "Same as Underlying Data".
Notes 30 minute periods are coded as inputs so you can adjust them other time periods as well.
The following 3 users say Thank You to SunTrader for this post:
(login for full post details)
#3 (permalink )
London, UK
Experience: Intermediate
Platform: Multicharts
Trading: eMini Futures
Posts: 29 since Mar 2012
Thanks: 6 given,
36
received
Carlera
Hi, I am trying to code a indicator than show a vertical line every 30 min, Can from 09:00 hrs to 16:00 hrs, I have gratefully.
I haven't fully tested this but it does draw Time Lines every 30 minutes between the desired time window - but you get the idea and should be able to tweak it as necessary.
Note:
1. It's important to set the plot's 'TYPE' to Histogram
2. You can turn it off by changing the Input, DrawTimeLines to False
3. TimePeriod can be changed to draw lines every 15, 10, 5 minutes etc.
Code
Inputs: DrawTimeLines(True);
Vars: TimePeriod(30), MinsPastHour(0), LineColor(Red),
IntraBarPersist LastTimeLine(0);
If DrawTimeLines and Time >= 900 and (Time - LastTimeLine > (TimePeriod -1)) then
begin
If Time <= 1600 then
begin
MinsPastHour = Mod(MinutesFromDateTime(DateTime), TimePeriod);
If MinsPastHour = 0 then
begin
Plot1(Close*2, "TimeLine", LineColor); // **** Set Plot 'Type' as Histogram ****
LastTimeLine = Time;
end
else
begin
Plot1(0);
end;
end
else
LastTimeLine = 0;
end;
The following 2 users say Thank You to JoeDee for this post:
Last Updated on September 26, 2022
Ongoing