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

Time Format

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

    Time Format

    I use an indicator doing this :

    Print(">>BUY " + Time[0].Ticks.ToString() + " : " + Close[0].ToString("0.00"));

    in the output window I get :

    '>>>BUY 633222774000000000 : 1478.50'

    I searched in the Help File and couldn't find out the way to code my indicator so as to get a time stamp in the line of the T&S Window, for instance : 17:29:56 which is a more readable HH:MM:SS format.

    #2
    How about
    Print(">>BUY " + Time[0].ToString() + " : " + Close[0].ToString("0.00"));

    Comment


      #3
      I already tried that but I wish to display the accurate time not the bar time; so I guess I will have to convert time stamp from 100-nanosecond units.

      Comment


        #4
        You mean the actual local time of your PC? Please try this:
        Print(">>BUY " + DateTime.Now.ToString() + " : " + Close[0].ToString("0.00"));

        Comment


          #5
          Actually, what I am looking for is the accurate T&S time but I guess this is out of the scope of this forum support; so when I have some time left I will cope with converting from nanoseconds.

          Comment


            #6
            Dealing with nanoseconds does not make difference: Time[0] still will be the timestamp of the actual and not the time as a tick came in (like in T&S window). You need to write to the market data stream, which is not officially supported in NT6, but will be in NT 6.5, fall time frame. Please take a look at e.g. VolumeProfile indicator, OnMarketData method if you want to get into that based on NT6.

            Comment


              #7
              As I already figured out that NT 6.5 release is going to be a golden one because, in my opinion, access to market data is one of the most valuable clues.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by stafe, 04-15-2024, 08:34 PM
              10 responses
              42 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by frslvr, 04-11-2024, 07:26 AM
              8 responses
              111 views
              1 like
              Last Post NinjaTrader_BrandonH  
              Started by rocketman7, Today, 09:41 AM
              3 responses
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by traderqz, Today, 09:44 AM
              2 responses
              5 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by rocketman7, Today, 02:12 AM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X