Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question: Time window based entry

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

    Question: Time window based entry

    Hi All

    My strategy is time-based, so I can only enter on certain time and price windows.

    Price is very simple with a limit order, but is it possible to add somehow a time window, in which the order is active?

    Thanks a lot for your help,

    #2
    I have strict trading times that I want to adhere to. This is a line from my code to make a bool value of "if it's between x and y".

    IsitTime = ToTime(Time[0]) >= StartTime && ToTime(Time[0]) <= EndTime;

    IsItTime is a boolean
    StartTime and EndTime are Integers.

    Note that with time, you use the hhmmss. So 5:45am is "54500". And 7pm is "190000"
    Last edited by alphatango; 11-11-2023, 09:05 PM.

    Comment


      #3
      Thanks for your answer! I'm on the computer, planning the trade so more important would be that the order is at a certain time invalid and canceled, if the entry was not hit.

      how do I make that work, or where can I read more about it?

      Comment


        #4
        Hello bo0sti,

        Thanks for your post.

        You could consider implementing Time Comparison conditions or Time Filters within your script to limit the times that a strategy places orders.

        See the help guide documentation below for more information about creating Time Comparison conditions and Time Filters.

        <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

        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