Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Comparisons - Trade Exit

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

    Time Comparisons - Trade Exit

    Hi,

    When I build a strategy and add a Begin time using:

    ToTime(Time[0]) > (ToTime(Time(3,0,0)

    it works fine but when I add an exit time to the Strategy it seems to go unnoticed and the Strategy will continue onward.

    For example the End time that I have been using is:

    ToTime(Time[0]) < ToTime(7,8,0)

    I have also gone into the code and edited the End time to read:

    ToTime(Time[0]) < ToTime(10,10,00))

    Therefore how I do create an End time that works and also how do I go back using the Strategy wizard once I click on "unlock code" and manually compile the code?

    Thank you,

    #2
    Scarlett,

    Unfortunately there is no way to go back to the strategy wizard once you unlock the code. You can however continue to use the condition builder.

    Here is a tutorial : http://www.youtube.com/watch?v=JZpo01eSO9c

    As far as your question, a proper time filter would look something like this.

    Code:
                      if (ToTime(Time[0]) >= ToTime(8, 30, 00)
                    && ToTime(Time[0]) <= ToTime(16, 0, 0))
                   {
                   }
    This would be checking to make sure the time is between 8:30 AM and 4:00 PM
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X