Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

turning a strategy on and off with a timer

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

    turning a strategy on and off with a timer

    Is there a way to turn a strategy on at a specific time and then have it stop taking on new positions after a certain time. For example, set the strategy to enable itself at 9:30am est and then stop putting on any new positions after 10am est. So after 10am est it would unwind any positions that are still open using the strategy exit criteria but would no longer take on any new positions after 10am and remain flat for the end of the 24 hour session for that contract. Is this possible with ninjatrader 8?

    #2
    Hello gordongekko,

    Thanks for opening the thread.

    It would not be possible to programmatically enable a strategy. The recommended approach would be to add time checks to the strategy so actions can be taken at given times, or to stop taking actions after another time. The strategy would then be enabled and take desired actions at the programmed times.

    An example strategy that incorporates time checks can be found here - https://ninjatrader.com/support/foru...ead.php?t=3226

    Closing open positions can be made by calling ExitLong()/ExitShort(). I've included publicly available documentation links below.

    ExitLong() - https://ninjatrader.com/support/help...s/exitlong.htm
    ExitShort() - https://ninjatrader.com/support/help.../exitshort.htm

    Please let us know if we can be of further help.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X