Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time to bar conversion

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

    Time to bar conversion

    How do I get the bars number of the 1 tick series for some arbitrary amount of time (say, 30 seconds) before the current bar ?

    #2
    Hi Spotty, thanks for posting. You will need C# logic that will loop back through the historical bars and stop at a certain point. I would use a While loop to do this and use the DateTime.Compare() method to compare the tick's timestamp to a hard coded timestamp.

    The method in C# is used for comparison of two DateTime instances. It returns an integer value indicating the relationship between the two dates − Following is the syntax for method − The method returns an integer value − The following example


    Kind regards.

    Comment


      #3
      Hmm. Well, what I'm trying to do is get the lowest tick price over that time interval, and am thinking "LowestBar()" will part of this solution. So, isn't there a way within NT to convert a time to a bar? I'm pretty sure I've done this before. I've scoured the HelpGuide, but can't find it now. I must be looking in the wrong place. Any ideas?

      Comment


        #4
        Hi Spotty, I attached an example our colleague made. It builds minute bars from tick data. This is the closest example of doing this.

        Kind regards.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        198 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        364 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        283 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X