Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Time....

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

    Using Time....

    I would like to draw a Horizontal Line starting (ex: 9am) and extending to the right.

    I will check the (Time[0].Hour) and (Time[0].MInute to find the start location,
    but drawing the line stumps me.
    DrawLine has arguments for time, but what should I put in the DateTime endTime field ?

    As always....thanks for the help.....

    #2
    Are you working on 6.5 for this or 7? NT7 would also support drawing at a future price time, i.e. extended right this way...for 6.5 have you considered just using an extended line as method?

    Comment


      #3
      Apologies for not including that info.....
      For the time being (until NT7 goes live) I will be doing bot versions of Ninja.
      I use Ninja 7 for all initial indicator work and then 'back-port' the code to Ninja 6.5.

      What I am after is to draw a line that will continue from my current bar position,
      extending right (into the future) as a Support/Resistance line.

      I already have code to determine where the line starts, but am having trouble getting the line to draw to the right and then keep going. I looked at the extended method, but it appeared to only go backwards from my current bar, to a point in history.


      Thanks for the assistance....

      Comment


        #4
        Several options are available here - first it sounds like you don't need to draw into the future just amend the line as the chart moves forward, for this for example start at your determined time point and just use the current bar's timestamp as the end point while reusing the same tagID for the line, this will update the line as you go.

        Comment


          #5
          Hmmm...OK

          So....

          =============
          determine start point
          - save Y axis info for start point (e.g. anchorY = High[0];
          - save DateTime.Now for the start point (xxxxxxxxx)
          then

          DrawLine("line1", true, xxxxxxxxx, anchorY, DateTime.Now, anchorY, Color.Blue, DashStyle.Solid, 2);

          My next question....(pardon my slowheadedness)
          is how do I capture the start time for "xxxxxxxxx"?
          (It is not an int or double....)
          --------------------------------------------------------------------------
          One last (I hope last . ) question...
          If I wanted to make the start time selectable from the indicator, how
          would I enter the "start time"?

          [Description("start time")]
          [Category("Parameters')]
          public xxxxxxxxxx StartTime
          {
          get { return xxxxxxxxxx

          }
          Last edited by photog53; 06-18-2010, 11:16 AM.

          Comment


            #6
            Hello Photog,

            That is a DateTime object.

            You can see the reference sample below for help on working with this type of object:

            Indicator: Manipulating DateTime objects


            For a sample implementation of User Definable date time, see the link below:
            Calculating the highest high or lowest low for a specified time range
            Last edited by NinjaTrader_RyanM1; 06-18-2010, 11:37 AM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks!!! (I appreciate the quick response)

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              574 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              333 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X