Vertical Line every 30 min. - futures io
futures io



Vertical Line every 30 min.


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one JoeDee with 1 posts (2 thanks)
    2. looks_two Carlera with 1 posts (0 thanks)
    3. looks_3 SunTrader with 1 posts (3 thanks)
    4. looks_4 eskules with 1 posts (0 thanks)
    1. trending_up 1,837 views
    2. thumb_up 5 thanks given
    3. group 5 followers
    1. forum 2 posts
    2. 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)

 
Search this Thread
 

Vertical Line every 30 min.

(login for full post details)
  #1 (permalink)
Carlera
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.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Multi Time Frame High/Low/Median levels
NinjaTrader
Big Mo Indicator for NT8
NinjaTrader
help with take profit several targets
TradeStation
Market on Close data within IB
Platforms and Indicators
Multiple brokerage accounts within one or more brokers
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
123 thanks
ApexTraderFunding.com experience and review
11 thanks
Want your NinjaTrader indicator created, free?
7 thanks
Artificial Intelligence (AI) and Chat GPT
7 thanks
Dax market profile (FDAX, TPO)
7 thanks
 
(login for full post details)
  #2 (permalink)
SunTrader
Boca Raton, FL
 
 
Posts: 230 since Nov 2018
Thanks: 70 given, 164 received


Carlera View Post
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.

Reply With Quote
The following 3 users say Thank You to SunTrader for this post:
 
(login for full post details)
  #3 (permalink)
 JoeDee 
London, UK
 
Experience: Intermediate
Platform: Multicharts
Trading: eMini Futures
 
Posts: 29 since Mar 2012
Thanks: 6 given, 36 received



Carlera View Post
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;

Reply With Quote
The following 2 users say Thank You to JoeDee for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Vertical Line every 30 min.


Last Updated on September 26, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts