NexusFi: Find Your Edge


Home Menu

 





Session Lines indicator help please


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gever17 with 3 posts (1 thanks)
    2. looks_two cory with 2 posts (2 thanks)
    3. looks_3 Silvester17 with 1 posts (3 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,471 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

Session Lines indicator help please

  #1 (permalink)
 gever17 
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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090



gever17 View Post
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/

Reply With Quote
Thanked by:
  #4 (permalink)
 gever17 
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

Started this thread Reply With Quote
  #5 (permalink)
 
Silvester17's Avatar
 Silvester17 
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 View Post
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"


Reply With Quote
Thanked by:
  #6 (permalink)
 gever17 
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

Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
cory's Avatar
 cory 
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.

Reply With Quote




Last Updated on January 23, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts