Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Date box in Data Series window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Date box in Data Series window

    Hi,

    In my indicator, one of the user parameters is a Date entry. Right now, I'm using NT's ToDay() format ("20121001" for Oct 1, 2012).

    I would like to know if there's a way to code in a proper Date box like the one that exists in the Data Series window for "Start date" and "End date"? (see attachment).

    Would appreciate if anyone could assist, or at the least, point me in the correct direction for more research.

    Thanks!

    -Nick
    Attached Files

    #2
    Hello Nick,

    You may do something like:

    Code:
    #region Variables
                
    	private DateTime myDateTime = new DateTime(2013,2,20); 
          
    #endregion
    
     #region Properties
           	[Description("")]
    	[GridCategory("Parameters")]
    	public DateTime MyDateTime
    	{
    		get { return myDateTime; }
    		set { myDateTime = value; }
    	}
    #endregion
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks JC!

      Is there any way to make it default to the current day's date?

      I tried

      private DateTime myDateTime = new DateTime(DateTime.Today);

      and that didn't turn out right

      My C# skills are absolutely noobish, unfortunately.

      -Nick

      Comment


        #4
        Hello Nick,

        Code:
        private DateTime myTime = new DateTime(DateTime.Today.Year,DateTime.Today.Month, DateTime.Today.Day );
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        37 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        23 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        152 views
        2 likes
        Last Post CaptainJack  
        Working...
        X