PDA

View Full Version : Get Current TIme


frostbyte
09-16-2009, 08:51 AM
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!

NinjaTrader_Josh
09-16-2009, 09:14 AM
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/vb/showthread.php?t=19292

frostbyte
09-16-2009, 12:47 PM
Great Thanks!