• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add a switch based on time since session start (throgh Wizard)

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

    How to add a switch based on time since session start (throgh Wizard)

    Hi,
    I am trying to add a on/off switch that would forbid my strategy to make any entries a certain amount of time since session has started.

    I know how to make custom variables, however I can't figure out how to create a rule with the Time parameter from the condition builder.

    Some help will be appreciated.

    Thanks.

    #2
    Hello Nikolaalx,

    Thanks for your post.

    To add a time based switch in the condition builder you have 3 options, Date, Bar and time. I created a condition that says if the current bar is greater than a set time. I have attached two pics to show the steps to do this in the strategy wizard.

    Please let me know if I can be of further assistance.
    Attached Files
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the suggestion.

      I have just one more question. How can I optimize the time value? I see that it is i n hh:mm format...and in the user defined variables, I can choose from integer, boolean, string or double.

      Thanks.

      Comment


        #4
        Hello Nikolaalx,

        Thanks for your post and question.

        In the strategy wizard you cannot connect the ToTime with integer inputs. This means you would only be able to set the time by opening the wizard and changing it each time you wanted to make a change.

        If you wish to have the ability to set the time without having to go through the strategy wizard each time you can "unlock" the code to make the changes to connect the integer inputs to the ToTime. I have attached the strategy example that now has an input for hour and an input for minute. The output of the strategy is to simply color the background of the chart as a demonstration of function. Please see the picture below that shows both the strategy parameter window and the output.

        Here is a link that further shows how to use a time filter to limit trading hours. http://www.ninjatrader.com/support/f...ead.php?t=3226

        Please let me know if I can be of further assistance.
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NT-Roland, Today, 04:36 PM
        0 responses
        1 view
        0 likes
        Last Post NT-Roland  
        Started by Newtrader101, Today, 03:40 PM
        2 responses
        6 views
        0 likes
        Last Post Newtrader101  
        Started by Branpo, Today, 02:58 PM
        2 responses
        5 views
        0 likes
        Last Post Branpo
        by Branpo
         
        Started by sdauteuil, Today, 02:09 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by AMATX, Today, 02:19 PM
        2 responses
        7 views
        0 likes
        Last Post AMATX
        by AMATX
         
        Working...
        X