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?
    BertrandNinjaTrader Customer Service

    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 burtoninlondon, Today, 12:38 AM
      0 responses
      3 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      12 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,982 views
      3 likes
      Last Post jhudas88  
      Working...
      X