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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        72 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        152 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X