• 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

Time as input

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

    Time as input

    Hi all,

    Is it possible to use Time (HH:MM or any other format) as a user input using Wizard?

    Best Regards,
    Carlos

    #2
    Hello CarlosTTW,

    I am including a picture where I have loaded up a time value in the Condition Builder section of the Strategy Wizard. You can reach this screen from the 4th page of the Strategy Wizard by clicking the uppermost Add button on the right.

    Please let us know if there are any other ways we can help.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Jessica,

      But how can I define time as user input? Is it a integer (or double) variable?

      Comment


        #4
        NinjaTrader contains the convenience method ToTime. I will provide a help guide excerpt.

        Originally posted by http://ninjatrader.com/support/helpGuides/nt7/totime.htm
        Integer representation of time is in the following format Hmmss where 7:30 AM would be 73000 and 2:15:12 PM would be 141512.
        Thus, if you take an integer input as user input, where the ten-thousands and hundred-thousands digits are the 24 hour local time, the hundreds and thousands digits are the minutes, and the tens and ones digits are seconds, with no leading zero(es) for hours 0-9, then you can compare these to times which involve the ToTime() method, including wizard generated times.

        Please let us know if there are any other ways we can help.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Jessica, I understand what you mean.

          But, how to define following condition using Wizard:

          If current bar close (current time) > StartTime (defined input for example 093000) Then enter long

          Thanks again,
          Carlos

          Comment


            #6
            Hello again CarlosTTW,

            What you are attempting is currently not possible using the strategy wizard alone. You will need to unlock your Strategy code, or click generate on your Indicator code, and then compare the output of ToTime(hour, minute, second) to the integer you input.

            You can, however, generate most of this code through the wizard. I am including a picture with an example you can use on page 3 of the strategy wizard. On page 4, in the condition builder, simply set both the left and right hand sides to the time value I showed you for the left hand side earlier.

            Once you have done all that through the wizard, you can then compare the output of ToTime(hour, minute, second) directly to the value of TimeToDoStuff .

            Please let us know if there are any other ways we can help.
            Attached Files
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Thanks Jessica, it works perfect.

              One more question. I supose it is the same procedure for dates, isn't it?

              Regards

              Comment


                #8
                Correct, except that you would use the ToDay() method , http://ninjatrader.com/support/helpGuides/nt7/today.htm , in YYYYMMDD format where YYYY is the 4 digit year (10 millions through 10 thousands), MM is the 2 digit month (thousands and hundreds), and DD is the 2 digit day of the month (tens and ones).
                Jessica P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rontronimous, Today, 06:12 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by Vinhasa, Today, 03:15 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by 1001111, Today, 03:03 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Tyler  
                Started by Seedbird, Today, 03:06 PM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_BrendanC  
                Started by mtamaku, Today, 02:46 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Kate  
                Working...
                X