Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Date comparison in Condition Builder

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

    Date comparison in Condition Builder

    I am using Condition Builder to evaluate some seasonal strategies via backtesting. I want to be able to enter a trade only in a certain date range.

    It looks like I should be able to use "date value" in condition builder. What do I enter as the "value" under "parameters" to represent the date of the current bar? (I am asking about doing this in condition builder, not in the code itself.)

    Thank you.

    #2
    Hello Pitchfork,


    For your question, the CurrentBar's time would be the Time Series with 0 as the bars ago in the condition builder. To compare the time, you could do the following:

    For a date range using the condition builder, you could use 2 conditions. The first will be the starting date compared to the current bars time. The second would be the end date compared to the current bars time.

    If the current bars time is between these two dates, then proceed.

    To do this in the condition builder you could do the following:
    • In Set 1 tab add a new condition.
    • In the condition select in the left column "Time Series" and set the bars ago to 0 . we are getting the current time of the bar being processed.
    • In the center choose > or >= depending on if you want the start date included or not.
    • On the right side you would need to select "Date Value" and select a start date.
    • Click OK and go to the previous screen, this completes the first of two conditions.


    Next again in the same Set 1 tab create a second condition.
    • This time on the left choose "Time Series"
    • In the center choose < or <=
    • on the right again choose "Date Value" and set the end date this time.


    Now when you click OK you should have something similar to what I have in the screenshot I have included.

    In the screenshot I have specified that if the current bars date is between 06/01/2014 - 06/24/2014 then the condition would be true.


    Please let me know if I may be of additional assistance.
    Attached Files

    Comment


      #3
      NT_Jesse,

      Thank you for the timely reply. Got that working now.

      Comment

      Latest Posts

      Collapse

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