Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error when using CancelOrder

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

    #16
    Hello RobotSyndicate,

    Put NinjaTrader.Core.Globals.Now in ToTime().

    Print(ToTime(NinjaTrader.Core.Globals.Now)); <-- this prints the current computer time represented as an integer.

    This is what I have suggested in Post #8.

    From the help guide:
    "ToTime(DateTime time)"

    It states this works with a DateTime object. NinjaTrader.Core.Globals.Now is a DateTime object with the current date and time.

    There is no bar information in what I have suggested.
    The the time of a bar is Time[0], which is not used in my suggestion.
    Last edited by NinjaTrader_ChelseaB; 06-29-2022, 11:31 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Ah yes, yes you did. Thank you Chelsea. Do you happen to know if I can pull out the day of the week as an integer from NinjaTrader.Core.Globals.Now as can be done with DateTime? Like with DateTime I would do:

      DateTime now = DateTime.Now;
      weekDay = (int)now.DayOfWeek;

      to get a 0-6 value for the int weekDay.

      thanks for all you do!

      Comment


        #18
        Hello RobotSyndicate,

        Yes, Core.Globals.Now is a DateTime object. Use it the way you would any other DateTime object.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        55 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        132 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X