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

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 :

            BertrandNinjaTrader Customer Service

            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 Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  19 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Working...
                  X