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 kevinenergy, 02-17-2023, 12:42 PM
      118 responses
      2,778 views
      1 like
      Last Post kevinenergy  
      Started by briansaul, Today, 05:31 AM
      0 responses
      9 views
      0 likes
      Last Post briansaul  
      Started by traderqz, Yesterday, 12:06 AM
      11 responses
      28 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by PaulMohn, Today, 03:49 AM
      0 responses
      8 views
      0 likes
      Last Post PaulMohn  
      Started by inanazsocial, Today, 01:15 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jason  
      Working...
      X