Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

horizontal line for current price

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

    horizontal line for current price

    Is there an existing code out there for a simple horizontal line painted on the current price? If so, can someone point the way for me? Thanks

    #2
    SinatraFan,

    I believe the following link will help you out.

    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks... that is exactly what I needed. Now for another question.... Is there a way to paint a histogram at the bottom of the chart? I would like to paint a small bar during the times that I trade (say from 5am to 4pm. I would like a little bar at the bottom to easily identify when I'm looking at historical charts. Is there something out there that does this or perhaps some easy code? Thanks

      Comment


        #4
        SinatraFan,

        Sure, this is possible. You could create an indicator with a time filter. In your OnBarUpdate, something like this would work.

        Code:
        if( ToTime(Time[0]) > ToTime(5,0,0) && ToTime(Time[0]) < ToTime(16,0,0) )
        {
            Plot0.Set(1);
        }
        else
        {
            Plot0.Set(0);
        }
        Essentially, this will assign a 1 to the plot if its during your trading hours, and a 0 if not.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Could you elaborate a bit more... I've never coded anything in NT... only tradestation and it's a bit foreign to me. How would I put that into an indicator?

          Comment


            #6
            SinatraFan, if you've never coded before in NT I would suggest starting out with those tutorials here to learn how the NinjaScript framework operates :

            Comment


              #7
              Originally posted by SinatraFan View Post
              Thanks... that is exactly what I needed. Now for another question.... Is there a way to paint a histogram at the bottom of the chart? I would like to paint a small bar during the times that I trade (say from 5am to 4pm. I would like a little bar at the bottom to easily identify when I'm looking at historical charts. Is there something out there that does this or perhaps some easy code? Thanks
              Why not just change the background color?

              Comment


                #8
                How do you do that??? I'm really green at NT... very well versed at easylanguage... but know nothing about c#

                Comment


                  #9
                  Originally posted by SinatraFan View Post
                  How do you do that??? I'm really green at NT... very well versed at easylanguage... but know nothing about c#
                  Follow the link to Turorials that Bertrand gave you. You will see that the Level 6 one does what we are discussing. If you are new to NInjaScript, you might want to start from Turotial 1. AS you already know how to code in another language, your learning curve will not be too steep.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by cmoran13, 04-16-2026, 01:02 PM
                  0 responses
                  43 views
                  0 likes
                  Last Post cmoran13  
                  Started by PaulMohn, 04-10-2026, 11:11 AM
                  0 responses
                  25 views
                  0 likes
                  Last Post PaulMohn  
                  Started by CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  163 views
                  1 like
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  98 views
                  1 like
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  158 views
                  2 likes
                  Last Post CaptainJack  
                  Working...
                  X