Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 tkaboris, Today, 07:53 PM
    0 responses
    1 view
    0 likes
    Last Post tkaboris  
    Started by JGriff5646, Yesterday, 05:47 PM
    2 responses
    20 views
    0 likes
    Last Post JGriff5646  
    Started by lezlebric, Today, 06:32 PM
    0 responses
    12 views
    0 likes
    Last Post lezlebric  
    Started by TheTechnician86, Today, 05:47 PM
    0 responses
    9 views
    0 likes
    Last Post TheTechnician86  
    Started by Ryan333, Today, 05:25 PM
    0 responses
    6 views
    0 likes
    Last Post Ryan333
    by Ryan333
     
    Working...
    X