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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        475 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        316 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        253 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        340 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        305 views
        0 likes
        Last Post CarlTrading  
        Working...
        X