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

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?

    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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 arvidvanstaey, Today, 02:19 PM
              4 responses
              11 views
              0 likes
              Last Post arvidvanstaey  
              Started by samish18, 04-17-2024, 08:57 AM
              16 responses
              60 views
              0 likes
              Last Post samish18  
              Started by jordanq2, Today, 03:10 PM
              2 responses
              9 views
              0 likes
              Last Post jordanq2  
              Started by traderqz, Today, 12:06 AM
              10 responses
              18 views
              0 likes
              Last Post traderqz  
              Started by algospoke, 04-17-2024, 06:40 PM
              5 responses
              48 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X