Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Input Parameters for Day & Time Variables

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

    Input Parameters for Day & Time Variables

    Hello!

    I need to know how to create input parameters in NinjaScript properties that allow inputting a date, not just a time. I have to input both a day and a time in my indicator.

    I don't know NinjaScript or C# adequately enough to do it alone. I once saw a NinjaScript indicator showing how to code this, but I can't find it again.

    Any hint about it? I don't mind getting my hands dirty coding; It's the best way to learn.

    #2
    Hello Gianpiero,

    You can use the following property to generate a date picker plus time entry. The time is typed in where as the date is selected.

    Code:
    [NinjaScriptProperty]
    [PropertyEditor("NinjaTrader.Gui.Tools.ChartAnchorTimeEditor")]
    [Display(Name="MyDateTime")]
    public DateTime MyDateTime { get; set; }

    Comment


      #3
      Great! That's exactly what I needed

      Comment


        #4
        Hi Jesse,
        How do I save a value for this variable? I tried to assign a value like this in SetDefaults: DateTime myDateTime = 120000; OR myDateTime = 120000;

        Neither Worked...

        Comment


          #5
          Hello whiterhino,

          If you are using a DateTime property you need to make a new DateTime to assign it like you are. What you are using is an int which is not the same as a DateTime.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          155 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          90 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          137 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          130 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X