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 rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by realblubb, Today, 09:28 AM
      0 responses
      2 views
      0 likes
      Last Post realblubb  
      Started by AaronKoRn, Yesterday, 09:49 PM
      1 response
      18 views
      0 likes
      Last Post Rikazkhan007  
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      12 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Working...
      X