Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Session Lines indicator help please
Updated January 24, 2013
Top Posters
looks_one
gever17
with 3 posts (1 thanks)
looks_two
cory
with 2 posts (2 thanks)
looks_3
Silvester17
with 1 posts (3 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
1,471 views
thumb_up
6 thanks given
group
2 followers
forum
6 posts
attach_file
1 attachments
Session Lines indicator help please
January 23rd, 2013, 04:02 PM
Cheyenne,Wyoming...USA
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54
Hello
Thanks for looking!!!
I am trying to get this user defined Session Lines Indicator of mine to plot on minutes instead of only hours. Right now it will only work on the hour. ....ie 800 or 1400 hours.
I want to be able to do 730 and 1415.
Thought I had it figured out but it wont plot. Searched everywhere I could think of but cant seem to find the right code.
In this code I was working with and trying to modify time1....
Here is the code:
Code
[Description("Plots vertical lines as per UI")]
public class SessionLinesGE : Indicator
{
#region Variables
private int time1 = 73000; //Changed this from 8 to 73000
private int color1 = 1;
private int time2 = 14;
private int color2 = 1;
private string name;
private int i=0,j=0;
#endregion
protected override void Initialize()
{
DrawOnPricePanel = true;
Overlay = true;
}
protected override void OnBarUpdate()
{
if (CurrentBar<2) return;
if (time1!=0)
{
if (Time[0].Minute == time1 && Time[1].Minute < time1) //changed this from .Hour to .Minute
{
name = "Line1"+i;
if (color1==1)
{
DrawVerticalLine(name,0,Color.DimGray,DashStyle.Dot,2);
}
i++;
}
}
if (time2!=0)
{
if (Time[0].Hour == time2 && Time[1].Hour < time2)
{
name = "Line2"+j;
if (color2==1)
{
DrawVerticalLine(name,0,Color.DimGray,DashStyle.Dot,2);
}
j++;
}
}
}
#region Properties
[Browsable(false)]
[XmlIgnore()]
public DataSeries Plot0
{
get { return Values[0]; }
}
[Description("Hour of Line1 (0 = do not plot)")]
[GridCategory("Parameters")]
public int Time1
{
get { return time1; }
set { time1 = Math.Min(Math.Max(10000, value),240000); }// Changed this from Math.Max(1, value) to Math.Min(Math.Max(10000, value),240000)
}
[Description("")]
[GridCategory("Parameters")]
public int Color1
{
get { return color1; }
set { color1 = Math.Max(1, value); }
}
[Description("Hour of Line2 (0= do not plot)")]
[GridCategory("Parameters")]
public int Time2
{
get { return time2; }
set { time2 = Math.Max(1, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int Color2
{
get { return color2; }
set { color2 = Math.Max(1, value); }
}
#endregion
}
}
Any advice on this would be greatly appreciated!
Again, Thank you for looking!
gever17
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
January 23rd, 2013, 04:54 PM
virginia
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090
gever17
Hello
Thanks for looking!!!
I am trying to get this user defined Session Lines Indicator of mine to plot on minutes instead of only hours. Right now it will only work on the hour. ....ie 800 or 1400 hours.
I want to be able to do 730 and 1415.
Thought I had it figured out but it wont plot. Searched everywhere I could think of but cant seem to find the right code.
In this code I was working with and trying to modify time1....
use this search , key word 'session'
https://nexusfi.com/search/attachments/
January 23rd, 2013, 05:31 PM
Cheyenne,Wyoming...USA
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54
Hi @cory ,
Thank you very much for your time!!!
I tried searches but had no idea there was a search like this!
Not sure where to find this search method. I have simply bookmarked the link for the search!
Found exactly what I was looking for!
Thanks again!!! Cant express my gratitude enough!
gever17
January 23rd, 2013, 05:38 PM
Columbus, OH
Market Wizard
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527
gever17
Hi Cory,
Thank you very much for your time!!!
I tried searches but had no idea there was a search like this!
Not sure where to find this search method. I have simply bookmarked the link for the search!
Found exactly what I was looking for!
Thanks again!!! Cant express my gratitude enough!
gever17
@gever17 ,
top right corner, just click (like shown in pic) and a drop down menu appears. and then click on "search for attachments instead"
January 23rd, 2013, 05:49 PM
Cheyenne,Wyoming...USA
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: NQ, YM
Posts: 69 since Nov 2010
Thanks Given: 329
Thanks Received: 54
Thank you @Silvester17 !!!
Got it now!! Click in the empty search box!!!
I was always clicking on the "Search" button.
Funny part is I have probably seen that dropdown a thousand times. But just typed in my search and never paid attention! Details!!! Gotta see um!!!
Anyway thanks again for you time!!
gever17
January 23rd, 2013, 07:07 PM
virginia
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090
I think a button says 'more search options' is more helpful than clicking on an empty box for more search options but it is what it is.
Last Updated on January 23, 2013