Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Variables

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

    Time Variables

    Anyone know how to have different time intervals for optimization.
    For Example say I wanted to enter a trade at a certain hour then I can create a variable such as
    && ToTime(Time[
    0]) == ToTime(Hours, 0, 0)
    and this works ok
    but say that I also want to have a minutes variable as well
    && ToTime(Time[0]) == ToTime(Hours,Mins, 0)this doesn't work
    I also used two lines with hours in one and minutes in the other but either approach doesn't work .

    #2
    waza1960, what range of values are you then allowing for those 2 variables?

    Comment


      #3
      for hours the range I am trying is 1----12 & minutes 1---59 . Thanks

      Comment


        #4
        Hi waza1960,

        What interval are you running this against?

        Trading hours could range from 0-23. 0-59 is a valid range for minutes, but will also need to look at the interval you're using for this strategy. A 60 minute+ chart will not have any minute granularity.

        Example:
        Time[0] is the bar time stamp. There won't typically be a time stamp of 13:18 on a 15 minute interval. It would go from 13:15 and the next at 13:30.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          interval = 60 min chart
          Thanks

          Comment


            #6
            Ok, then please try to simply set the the inputs to a hour and minute range that should 'hit' on a present timestamp on your chart - would you then get an entry shown, so you would know the logic is working / triggering trades?

            Comment


              #7
              Ok, then please try to simply set the the inputs to a hour and minute range that should 'hit' on a present timestamp on your chart - would you then get an entry shown, so you would know the logic is working / triggering trades?
              Ok will do

              Example:
              Time[0] is the bar time stamp. There won't typically be a time stamp of 13:18 on a 15 minute interval. It would go from 13:15 and the next at 13:30.
              Does this mean that if I'm optimising on a 60min chart I can't optimise minutes because the Smallest Time Stamp here is 60mins/hour?

              Comment


                #8
                That's correct you would be limited to the timestamp granularity that your charted bars series offers, for a 1 minute for example this is down to the minute interval, but for a 60 min that would be only the hourly interval then. You could create a MultiSeries strategy though that would submit orders to a lower timeframe and thus you had access to smaller timestamps as well by using the Times[x] method.

                Comment

                Latest Posts

                Collapse

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