Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print(ToTime(Time[0]));

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

    Print(ToTime(Time[0]));

    what would cause this to print the wrong value.
    it is currently 11.20pm where i am
    when i run this function it is showing 50000 (500am)

    #2
    Hello fiddy,

    Using Print(ToTime(Time[0])) prints the time of the bars on the chart as integers. This does not print the current time.

    Is this the last appearing print in the output window?

    What is the time of the last bar on the chart?


    If you want to find the current time use DateTime.Now on a live account or use Bars.MarketData.Connection.Now if in market replay.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      i am using the following as part of strategy

      if ((ToTime(Time[0]) >= 220000 && ToTime(Time[0]) <= 240000))

      for some reason it wasnt triggering so i used the Print(ToTime(Time[0])) to find out what time was printing .

      the time doesnt match up to my current time

      what should i be using for this

      Comment


        #4
        Hello fiddy,

        That print should be printing more that one bar, it should be printing for every bar.

        Did you only receive one print in the output window?

        Can you include the full output?

        Can I see a screenshot of the chart?

        Is the Print(ToTime(Time[0])) call inside of a condition?

        The time filter in your post would trigger an action if the time is 10 PM or after and before or at 12:00 AM and is written correctly.

        The Print(ToTime(Time[0])) is printing the time of the bar. What bar is on the chart?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          it is printing for every bar.
          the time where i am is 232000 so the condition should have been triggering

          the issue seems to relate to my recent connection to interactive brokers
          i was having problem with data for some instruments so was given the following msg to follow:


          i followed the instructions from the msg but data doesnt seem to be coming through correctly. data has only updated up to yesterday close, no live data is coming thru.

          Comment


            #6
            the data is coming thru but it is not coming thru live.
            the data doesnt update unless i change the time period on the chart - then it updates
            how do i get the data to come thru live

            Comment


              #7
              Hello fiddy,

              Not all instruments are on the Nasdaq exchange. The exchange checked needs to match the instrument settings in TWS.

              Add this intrument to a row in TWS. Then right-click the row -> select Contract Info -> Description.

              Use check the exchange listed for the instrument in the Description.

              If the exchange is marked as SMART, add |SMART to the symbol mapping.

              I've created a short video to demonstrate.
              http://screencast.com/t/yN24GG3IXo

              If you would like assistance setting up the instrument correctly, please send an email to platformsupport [at] ninjatrader [dot] com. In the email, please include a link to this forum thread.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              562 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              325 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              547 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X