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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      177 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      332 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      254 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      356 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      184 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X