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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          553 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          100 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          543 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          546 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X