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

Getting Valid Time With Tick Info/Bars

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

    Getting Valid Time With Tick Info/Bars

    When I coded a project like this, it was very simple to add a Time array and put the approx. seconds into the same offset as the data. It would only take 5-10 lines of code.

    If you are unable to add the time to the tick bar, then consider numbering the tick bars/information within the Minute bar, and including the accumulation of pricing info from all tick bars so far that will make up the minute bar. Same basic logic as used with the other bars, as far as CurrentBar-type logic. At least that way, we could know where/when prices moved and on which bar a particular update occured.

    I am having to recode the tick time logic to include time as
    HH:MM:SS:TTTT where TTTT is the number of the tick bar within the
    minute bar.

    NONE of the conversations and recommendations have ANYTHING to do
    with displaying on a chart! It has to do with getting valid information EASILY and debugging logic. So far, all recommendations are pointing towards a complete rewrite of code logic on my part. Please consider looking at supplying information from our point of view.

    #2
    Chuck,

    Instead of opening new threads for follow up questions, we would appreciate it if you just replied to the same thread. Thank you.

    Not sure what you mean tick bars not having time. Tick bars are timestamped with the ending timestamp of that bar. Everything is in relation to the bar. Tick bars are NOT included in minute bars. They are completely separate objects.

    The timestamps of bars will not change. Minute bars have minute timestamps; tick bars, have timestamps representing whenever the particular tick bar closed. There is no intrabar granularity from within a minute bar when running historically to give you anything in relation to ticks. If you want intrabar information you need to work with multi-timeframe strategies.

    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Getting valid time

      The Tick Bars/Info Prices seem to be valid.
      Again, this has nothing to do with displaying on a chart, I just said that the main chart is a minute chart for discussion purposes.

      If the main chart is a minute chart, I can see every bar ending in 00 seconds. You said "tick bars, have timestamps representing whenever the particular tick bar closed."

      How do you get the seconds/timestamp 'IN NINJA CODE' when using 'FirstTickOfBar' logic? It always comes up as HH:MM:00. I'm sorry, but it just doesn't make any sense to me. Also, if you supported seconds or numbered the intrabars, it would be easy to allow historical testing.

      You said 'If you want intrabar information you need to work with multi-timeframe strategies.' The intrabar/tick info seems to be perfect when working with 'FirstTickOfBar' logic, except for time or the number of the tick bar. Why is it so difficult to get the time or bar sequence, when all other data seems perfect?

      Comment


        #4
        Chuck,

        That is not the way scripts work. Scripts work off of bar objects. You HAVE to choose whether you are running the script on minute bars, tick bars, or any other kinds of bars. This has nothing to do with charts, but is very easily visualized by using a chart. Based on the bar type you choose you will get timestamps of those bars. Minute bars = minute timestamps. Tick bars = timestamp of when the tick bar closes (with seconds).

        FirstTickOfBar has nothing to do with timestamps. Timestamps are determined by the bar type and the data. If you run your script on minute bars you will not get seconds because no minute bars will ever have a timestamp ending in the middle of a minute.

        When you are running a script there is no intrabar granularity. Each bar gives you OHLC. Each bar gives you the ending timestamp of that bar. There is nothing to number. What is numbered are the actually bar objects. You can't number something that doesn't exist.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X