Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Command with ATM

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

    Time Command with ATM

    Hi,

    I'm trying to add a condition to my IF statement for an ATM strategy that will execute trades every day only between 4PM (Current day) and 12:00PM (next day). I have tried doing this with the ToTime command but it doesn't seem to execute any trades.

    I am guessing ToTime might only work for same day executions...

    Any advice on a command for condition that might work for this purpose?
    Last edited by tjames3245; 09-03-2023, 02:28 PM.

    #2
    Hello tjames3245,

    Thanks for your post.

    You could create a Time Filter to check if the time is within a specific timeframe and flip a bool to true. Then, in your condition to place the trade you could check if the bool is true.

    This would require creating two time filters, one that checks if the time is between 4:00 PM to 11:59 PM and a second time filter that checks if the time is between 12:00 AM to 12:00 PM.

    See the 'How to create time filters' section of this help guide page for more information about creating Time Filters: https://ninjatrader.com/support/help...on_builder.htm

    Note that you would need to set the bools to false when the time is not between your specified times, otherwise, the bools will remain true.

    Debugging steps should be taken to determine how your strategy's logic is evaluating if the trades are not being placed as expected.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Good reading here.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 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