Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Disable Strategy at Specified Time

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

    Disable Strategy at Specified Time

    I'd like to know how to disable my active strategy at a specific time. I'm using the following code but is failing to disable the strategy.


    if (ToTime(Time[0]) >= ToTime(15,10,00))
    {
    Disable();
    }



    Thanks.

    #2
    Hi Mike, which chart type and interval are you running this code on? Have you checked with a Print statement or drawing action for visualizatin that the condition triggers for the disable?

    Comment


      #3
      Originally posted by Mikefra View Post
      I'd like to know how to disable my active strategy at a specific time. I'm using the following code but is failing to disable the strategy.


      if (ToTime(Time[0]) >= ToTime(15,10,00))
      {
      Disable();
      }



      Thanks.
      Why not just do it like this

      if(ToTime(Time[0]) >= 151000)
      {
      Disable();
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      68 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      24 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      27 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      54 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X