Print(string.Format("{0} | {1}", ToDay(Time[0]), ToTime(Time[0])));
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
Incorrect date and time when printing out
Collapse
X
-
Incorrect date and time when printing out
I want to click a button and have it print out in the output the day and time when the button was clicked, but it seems to print the previous day and the time of 180000 all the time. This seems to work fine in the strategy namespace.
Code:Tags: None
-
Hello tonystarks,
If this is in a button event you need to surround that code with a TriggerCustomEvent.
https://ninjatrader.com/support/help...tsub=triggercustom
Code:void YourButtonEvent() { TriggerCustomEvent(o => Print(string.Format("{0} | {1}", ToDay(Time[0]), ToTime(Time[0]))); }, null); }
JesseNinjaTrader Customer Service
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by arvidvanstaey, Today, 02:19 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 02:19 PM | ||
Started by mmckinnm, Today, 01:34 PM
|
3 responses
5 views
0 likes
|
Last Post Today, 02:12 PM | ||
Started by f.saeidi, Today, 01:32 PM
|
2 responses
6 views
0 likes
|
Last Post
by f.saeidi
Today, 02:10 PM
|
||
Started by alifarahani, 04-19-2024, 09:40 AM
|
9 responses
55 views
0 likes
|
Last Post Today, 02:02 PM | ||
Started by Conceptzx, 10-11-2022, 06:38 AM
|
3 responses
60 views
0 likes
|
Last Post Today, 01:46 PM |
Comment