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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          27 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          17 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          9 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          10 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          17 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X