• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time value

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

    Time value

    Can you advise how to get a time value updated each second?

    ToTime(Time[0]) function gives only a value of bar's opening.

    #2
    Hello alexeymarvel,
    You can use the DateTime.Now function to get the current timestamp of your PC.

    http://msdn.microsoft.com/en-us/libr...etime.now.aspx

    Please note it will work in realtime only and not for historical bars or in backtesting.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Yes I Know how to get it in real time. But how to get it in market replay mode?

      Comment


        #4
        Hello alexeymarvel,
        You can try the below unsupported code

        Code:
        this.Bars.MarketData.Connection.Now
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          It gives the same value as Time[0] as at bar's open. But I need the timer the same as in the replay window.

          Comment


            #6
            Originally posted by alexeymarvel View Post
            It gives the same value as Time[0] as at bar's open. But I need the timer the same as in the replay window.
            In what event handler are you using the construct ?

            Comment


              #7
              Hello alexeymarvel,
              In addition to koganam's query, can you say what CalculateOnBarClose you are using?

              I look forward to assisting you further.
              JoydeepNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by koganam, Today, 11:50 AM
              0 responses
              3 views
              0 likes
              Last Post koganam
              by koganam
               
              Started by Lancer, Today, 10:39 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Kate  
              Started by koganam, Today, 10:33 AM
              2 responses
              9 views
              0 likes
              Last Post koganam
              by koganam
               
              Started by FREEN, Today, 10:17 AM
              3 responses
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by stoner, Today, 08:38 AM
              4 responses
              17 views
              0 likes
              Last Post stoner
              by stoner
               
              Working...
              X