Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Today

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

    Time Today

    Hello,

    I cant find a topic about how to use in a script only current day like "if(day=today and time[]>....) then do"

    Working with time[] is clear for me but not how only for current day.

    Thank you!
    Tony

    #2
    Hello tonynt,

    If you mean the current day as in your PC time day you could use
    Code:
    NinjaTrader.Core.Globals.Now
    That would match the PC time and would have the offset applied that you selected in the platforms options menu.

    I look forward ti being of further assistance.

    Comment


      #3
      Hello,

      I have no idea what this means. Sorry. I thought I described it short and accurately. I dont want (because of cpu ressources) to have plottings for every day of the chart because its ok to have it only for current day. In utymonitor I have seen that text causes high numbers there. I try again with an example "if(time>9:30 EST && time<16:15 && today && Highs>SMA) then drawtextfixed "Hello Jesse I´m plotting only today and not yesterday after 9:30"

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        The property i provided is a DateTime which represents the PC clock time. If you wanted to know if the bar time is equal to todays date you could compare that property against a Time[0].Date.

        Code:
        if(Time[0].Date == NinjaTrader.Core.Globals.Now.Date)
        You can learn more about DateTime objects on MSDN: https://docs.microsoft.com/en-us/dot...ystem.datetime

        please let me know if I may be of additional assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X