Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Current Time

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

    Current Time

    How can I plot the exact current time in HHMMSS format on the chart? e.g.: How to plot the current time as well next to the bar timer counter with the Bar Timer indicator?
    Thanks!

    #2
    Hello Gregorio,

    Do you have a time object and you want to format this with a format string?

    Below is a link to the microsoft C# documentation on date and time format strings.
    Learn to use custom date and time format strings to convert DateTime or DateTimeOffset values into text representations, or to parse strings for dates & times.


    For example:
    Print(Time[0].ToString("HH:mm:ss"));
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I want to plot the time on the chart! Like the bar timer does, only it should plot the current time!

      Comment


        #4
        Hello Gregorio,

        To get the current time use DateTime.Now.

        To draw a text box in the bottom right corner use DrawTextFixed().


        You can update using a timer, or you could update in OnMarketData.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          How can I script, that I want to have the chart always on top! I know I can do it in the right click menu, but can I do this at all in script? I have an add-on to NT8 that opens in a new window but the right click menu doesn't show up! Can I just enter a line in the script to permanently make it "always on top"?

          The same with "Show Tabs"! The right click menu doesn't work so I want to know if I can make it "turned off" in the script!

          Comment


            #6
            Hello Gregorio,

            For future reference, below I am providing a link to the NinjaTrader 8 section of the forums.


            In NinjaTrader 8 the right-click context menu must be created by you for your addon.

            Attached is an example that demonstrates.
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mongo, Today, 11:05 AM
            0 responses
            1 view
            0 likes
            Last Post Mongo
            by Mongo
             
            Started by Tim-c, Today, 10:58 AM
            0 responses
            1 view
            0 likes
            Last Post Tim-c
            by Tim-c
             
            Started by traderqz, Yesterday, 09:06 AM
            3 responses
            23 views
            0 likes
            Last Post NinjaTrader_ThomasC  
            Started by f.saeidi, Today, 10:19 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by kujista, Today, 06:23 AM
            5 responses
            18 views
            0 likes
            Last Post kujista
            by kujista
             
            Working...
            X