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

CurrentDayOHL Question

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

    CurrentDayOHL Question

    Hello

    I'm using the standard CurrentDayOHL indicator and I'd like to modify it a bit by adding arrows to better highlight the Daily High / Low Lines on the chart (see attachment).

    Now, I know how to draw arrows on a chart, but only when they're linked to a bar/candle. How can I draw them linked to another object, like in this case the Daily High / Low lines?

    Thanks a lot for any suggestions.
    Attached Files

    #2
    Hello laocoon,
    Thanks for your note.

    Please refer to the below code which draws a Up Arrow on the current days high.

    Code:
    this.DrawArrowUp("up", true, 0, this.CurrentDayOHL().CurrentHigh[0], Color.Green);
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi Joydeep,

      Thanks a lot for your reply. Is there any way to break the link between the arrow and the most recent candle/bar? It would greatly increase the readability of the whole setup if the arrow was located more to the right of the chart, like in the attachment of my first post.

      Thanks again.

      Comment


        #4
        Hello
        Yes, you can set a -ive value for the barsAgo property.
        Code:
        this.DrawArrowUp("up", true, [B]-10[/B], this.CurrentDayOHL().CurrentHigh[0], Color.Green);
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Brilliant! That's exactly what I wanted, thanks a lot and have a nice weekend Joydeep.

          Regards

          Comment


            #6
            Hello Joydeep,

            I've got a quick follow-up question regarding the issue discussed below: my code is working very well, ie it draws a marker next to the Daily High / Low lines in order to increase their readability. What I'd like to do to further improve the indicator is to have those markers drawn only once the Daily High /Low line is at least two bars "old". If the market makes a new Daily High at 1330, I don't yet want to have a marker drawn (because the new high is too fresh and not very meaningful yet), but after the next 10 min candle closes at 1340 I want the marker to be drawn.
            How do I make sure the marker only appears once the Daily High / Low line is at least 2 bars old?

            Thanks a lot for your reply.

            Comment


              #7
              laocoon, you would need to look into adding code to keep track of the bar on which the new day high / low was established so you can then include a condition in your drawing updates to only proceed if you are on this bar + 2.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Thanks for your comment Bertrand. It made me think about the issue in a new way and I made it work.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by futtrader, 04-21-2024, 01:50 AM
                4 responses
                41 views
                0 likes
                Last Post futtrader  
                Started by Option Whisperer, Today, 09:55 AM
                1 response
                11 views
                0 likes
                Last Post bltdavid  
                Started by port119, Today, 02:43 PM
                0 responses
                3 views
                0 likes
                Last Post port119
                by port119
                 
                Started by Philippe56140, Today, 02:35 PM
                0 responses
                4 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                2 views
                0 likes
                Last Post 00nevest  
                Working...
                X