Thanks!
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!
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
NinjaTrader
display time and date
Collapse
X
-
display time and date
How can I display the current time and date in the chart windows for example in the top left corner?
Thanks!Tags: None
-
-
Hi AlanP,
do you have a version properly working or another utility like this but working ? Because this one is not running with the last NT 8 release ( I franckly dont know with the previous ones...), I mean that when you start NT and opened a chart with this utility installed, you can read date and time but time doesn't update automatically, and time shown compared to the windows clock in the bottom right corner is back ( seconds don't update, and minutes update every 5 minutes ....)
thanks in advance for your kind reply
Best regards
A.
Comment
-
Hello Alinghy,
What you are describing would be the scope of what was provided in this sample, this specifically uses the PC clock time and only updates with the charts bar updates. It sounds like you are using a 5 minute chart if you are seeing this only update each 5 minutes.
You can change the Calculate setting to OnEachTick if you would like to see more frequent updates, however this will still specifically reference the PC clock as that is what is programmed into the sample.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello Alinghy,
What you are describing would be the scope of what was provided in this sample, this specifically uses the PC clock time and only updates with the charts bar updates. It sounds like you are using a 5 minute chart if you are seeing this only update each 5 minutes.
You can change the Calculate setting to OnEachTick if you would like to see more frequent updates, however this will still specifically reference the PC clock as that is what is programmed into the sample.
I look forward to being of further assistance.
I am looking for a floating clock with seconds to place it on my workspace that updates continuously based on computer clock with seconds.
Any help is appreciated
Comment
-
Hello GussJ,
For an indicator, there would not necessarily be anything I could suggest as this generally relies on some platform events to drive the rendering/script logic. If there is no data to drive the script it would just have to wait.
You could create an addon window if you want a floating clock in the workspace, in a window you can really do whatever you wanted. You could use a timer to update a text control as one possibility. You can find a sample window/addon in the following page: https://ninjatrader.com/support/help...t_overview.htm This would be considered general C#/WPF/Xaml development so most xaml tutorials can assist in understanding how the UI is built in this sample.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello hir04068,
In this sample, Draw.TextFixed is used so this would default to the settings of the tool when not using an overload with a font. You can change the Draw.Text syntax in the script to use an overload that includes a font:
Code:Draw.TextFixed(this, "tag1", DateTime.Now.ToString(), TextPosition.TopLeft, ChartControl.Properties.ChartText, [FONT=Helvetica]ChartControl.Properties.LabelFont, Brushes.Blue, Brushes.Transparent, 0); [/FONT]
Code:new SimpleFont("Arial", 12)
JesseNinjaTrader Customer Service
- Likes 1
Comment
-
Hello, Quick question
with DateTime.Now.ToString() - it will print Date and time 6/3/2019 1:19:20 PM
is there a function that will only print the date? don't want time to be printed -like 6/3/2019
With ToDay(Time[0]) it is printing 20190603 --would like to have a separator like above
Thank you.
Comment
-
Hello chalasani,
You can use a format with ToString for this purpose. You can find more infomration about DateTime formats in the public link here: https://www.c-sharpcorner.com/blogs/...p-programming1
Code:Print(Time[0].ToString("MM/dd/yyyy"));
JesseNinjaTrader Customer Service
- Likes 2
Comment
-
Originally posted by NinjaTrader_AlanP View PostHello Gregorio1980,
I put together an indicator which will draw the current time in the upper left hand corner of the chart. Please see attached.
Please let us know if you need further assistance.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment