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 techgetgame, Yesterday, 11:42 PM
        0 responses
        8 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,613 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Yesterday, 05:56 PM
        0 responses
        10 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        20 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X