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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X