Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
        4 responses
        24 views
        0 likes
        Last Post Vietanhnguyen2hotmailcom  
        Started by PhillT, 04-19-2024, 02:16 PM
        4 responses
        36 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by ageeholdings, 05-01-2024, 05:22 AM
        5 responses
        38 views
        0 likes
        Last Post ageeholdings  
        Started by reynoldsn, Yesterday, 02:34 PM
        0 responses
        14 views
        0 likes
        Last Post reynoldsn  
        Started by nightstalker, Yesterday, 02:05 PM
        0 responses
        25 views
        0 likes
        Last Post nightstalker  
        Working...
        X