Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to execute something every hour/half hour etc

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

    How to execute something every hour/half hour etc

    Hi Guys, hopefully soon I'll start asking questions that are beyond novice level!

    However, say I have CalculateOnBarClose set to false and I want to do something at certain intervals, how can I code this?

    For example if I wanted to check every 60 minutes i could write
    pseudocode
    if time=09:00||10:00||11:00 ... etc or variations of that theme
    do something

    But there must be a more efficient way to do this i.e. some way to say
    if last two digits of time are 00 ... or 25 or whatever
    do something

    Like a substring type function? Been a while since I last wrote any code properly and I'm new to c#.

    Thanks,
    Al

    #2
    Just type Time[0]. into the editor, you will see the fields available in the time structure. You don't need to parse any strings, just evaluate those fields.

    Comment


      #3
      Perfect, cheers.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 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
      548 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      549 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X