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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        56 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        75 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        38 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        60 views
        0 likes
        Last Post PaulMohn  
        Working...
        X