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

NinjaTrader7: display time and date in chart

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

    NinjaTrader7: display time and date in chart

    Hello everybody
    I have a short question. I know this topic has been discussed many times but I have not found a solution for NinjaTrader 7.
    How can you easily display the time and date?
    I have attached the picture as I imagine
    Many thanks for your help
    Attached Files
    Last edited by bounty007; 10-26-2017, 04:11 AM.

    #2
    Hello bounty007,

    Thank you for the post and welcome to the NinjaTrader forum.

    I was not able to find a chart date/time display on the forums, so I modified the BarTimer indicator to print the time and date on the bottom right of the chart. Please see attached sample indicator.

    You can import this indicator by going to File > Utilities > Import NinjaScript > select the downloaded .zip file > Open. If NinjaTrader asks you to replace any files, say No.

    Here are some links to get you started with NinjaScript:



    You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:

    Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30
    Click here to see our NinjaScript Tips: http://www.ninjatrader.com/support/f...ead.php?t=3229

    Please let us know if you have any questions on the material.
    Attached Files
    Last edited by NinjaTrader_ChrisL; 10-27-2017, 10:34 AM. Reason: Added example
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi
      Super thank you.
      A small new problem.
      If I have now but the bar-timer still have, now these two lines come one over the other. (Time, Date & Bar-Timer) See the new picture
      Attached Files

      Comment


        #4
        Hello bounty007,

        Thanks for the follow-up.

        You can open the code (Tools>Edit NinjaScript), look for this line at the bottom:

        Code:
        graphics.DrawString(DateTime.Now.ToString(), ChartControl.Font, textBrush, bounds.X + bounds.Width - textWidth, bounds.Y + bounds.Height - textHeight, stringFormat);
        And replace that line with this:

        Code:
        graphics.DrawString(DateTime.Now.ToString(), ChartControl.Font, textBrush, bounds.X + bounds.Width - textWidth,( bounds.Y + bounds.Height - textHeight)-10, stringFormat);
        Then press F5 to compile, then press F5 on your chart to reload the NinjaScript.

        You can see that I modify the Y coordinate of the string being printed. This script is for educational purposes only.

        Please refer to the following links for further help on NinjaScript:





        Please let us know if we may be of any further assistance.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Like this?
          Attached Files
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            Hi can we do that on NT8?

            Comment


              #7
              Hi jdextras, thanks for your note.

              You can modify just about any chart element in NT8. There are a few examples posted here on adding your own elements to the chart, chart trader, superDOM, etc.

              Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


              If you have any questions on this please let me know.
              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              21 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              43 views
              0 likes
              Last Post jeronymite  
              Working...
              X