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

Get Current TIme

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

    Get Current TIme

    Hello all,

    I would like to get the Current Integer value of Hour, Minute, and AM or PM. This way I can incorporate Time into my strategy instead of using Session Begin & Session End.

    Result Example:
    pHour=7
    pMinute=32
    pAP=AM

    Thanks!

    #2
    You can get the current time by using ToTime(Time[0]). That will give it to you in one big number.

    For instance, 140000 would be equivalent to 2:00:00 PM. If you want to use the actual DateTime object you can see this tip: http://www.ninjatrader-support2.com/...ad.php?t=19292
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Great Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by joselube001, 05-10-2024, 12:17 PM
      5 responses
      23 views
      0 likes
      Last Post joselube001  
      Started by bigc0220, 09-18-2018, 09:16 AM
      6 responses
      2,579 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by lorem, 04-25-2024, 09:18 AM
      18 responses
      76 views
      0 likes
      Last Post lorem
      by lorem
       
      Started by DawnTreader, 05-08-2024, 05:58 PM
      21 responses
      81 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by doihaveto13, Today, 12:46 PM
      2 responses
      4 views
      0 likes
      Last Post doihaveto13  
      Working...
      X