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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        77 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X