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

Adding Line 20 points above Close Price

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

    Adding Line 20 points above Close Price

    Hello everyone,

    I was hoping someone could program this little addition for me on this indicator? What I am trying to do is simply have ninjatrader draw 1 Horizontal line above the current bid price at 20 points away, and 1 Horizontal line Below the current Bid Price also 20 points away.

    I have included the indicator that I am currently using for drawing the Bid Price, and then I have included a screenshot of what I was trying to get it to look like by adding the above and below Green Horizontal Lines.

    Or if anyone has another indicator that does this task, I can just simply use that indicator instead of having someone program this for me=)

    If anyone can program this, I will be forever grateful for your assistance! Thank you all,
    Attached Files

    #2
    Hi chrinist,

    Are you wanting 20 points or 20 ticks? (Points would be whole dollar)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by chrinist View Post
      Hello everyone,

      I was hoping someone could program this little addition for me on this indicator? What I am trying to do is simply have ninjatrader draw 1 Horizontal line above the current bid price at 20 points away, and 1 Horizontal line Below the current Bid Price also 20 points away.

      I have included the indicator that I am currently using for drawing the Bid Price, and then I have included a screenshot of what I was trying to get it to look like by adding the above and below Green Horizontal Lines.

      Or if anyone has another indicator that does this task, I can just simply use that indicator instead of having someone program this for me=)

      If anyone can program this, I will be forever grateful for your assistance! Thank you all,
      DIY ?

      Code:
      DrawHorizontalLine("Current_price+20",true,Close[0] + 20,LineColor,HorizLineStyle,line_Size);
      DrawHorizontalLine("Current_price",true,Close[0],LineColor,HorizLineStyle,line_Size);
      DrawHorizontalLine("Current_price-20",true,Close[0] - 20,LineColor,HorizLineStyle,line_Size);

      Comment


        #4
        Hello koganam, I did try your suggestion by adding your code. this was similar to what I was thinking and I tried this but it didnt draw correctly on ninjatrader. All I saw was 1 Yellow Price line but no other horizontal lines.

        Thanks for trying though,

        Anyone else have any ideas =)

        Comment


          #5
          Hello NinjaTrader_ChelseaB, that would be ticks. Thank you for helping me clarify that lol

          Comment


            #6
            Originally posted by chrinist View Post
            Hello koganam, I did try your suggestion by adding your code. this was similar to what I was thinking and I tried this but it didnt draw correctly on ninjatrader. All I saw was 1 Yellow Price line but no other horizontal lines.

            Thanks for trying though,

            Anyone else have any ideas =)
            Then it means that you did not copy correctly what I wrote.

            The picture shows it on GOOGL; the arrows pointing to the levels that you asked for. If you want it in ticks, then you will have to multiply the "20" added to the close by TickSize.
            Attached Files
            Last edited by koganam; 07-16-2014, 02:05 PM.

            Comment


              #7
              Hi chrinist,

              The lines drawn from Koganam's code is placing the lines at 20 points away. Without the autoscale they are off of the chart.

              Try the modified version attached.
              Attached Files
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_ChelseaB View Post
                Hi chrinist,

                The lines drawn from Koganam's code is placing the lines at 20 points away. Without the autoscale they are off of the chart.

                Try the modified version attached.
                He asked for lines 20 points away!

                I coded what he asked for.

                Comment


                  #9
                  Hi Koganam,

                  Yes you did!
                  (He did ask for points)

                  Thinking about it though, those lines should be showing because they are set to autoscale true.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChelseaB View Post
                    Hi Koganam,

                    Yes you did!
                    (He did ask for points)

                    Thinking about it though, those lines should be showing because they are set to autoscale true.
                    They are showing. Look at the picture that I posted. You may have to increase the contrast or lower the brightness on your screen: yellow on white never shows very well. The ochre arrows are pointing at the lines.

                    Comment


                      #11
                      Hi koganam,

                      I do see them in the screenshot, however, chrinist mentioned he is not seeing the lines.

                      Its possible the script was not compiled and reloaded on the chart though.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hi koganam,

                        I do see them in the screenshot, however, chrinist mentioned he is not seeing the lines.

                        Its possible the script was not compiled and reloaded on the chart though.
                        Then, as I said, it means that he did not copy correctly the code that I gave him. Given the results he reported, I am reasonably sure that he is using the same tag for all 3 lines. IOW, he ignored my additions to the tags.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by maybeimnotrader, Yesterday, 05:46 PM
                        2 responses
                        22 views
                        0 likes
                        Last Post maybeimnotrader  
                        Started by adeelshahzad, Today, 03:54 AM
                        5 responses
                        32 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by stafe, 04-15-2024, 08:34 PM
                        7 responses
                        32 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by merzo, 06-25-2023, 02:19 AM
                        10 responses
                        823 views
                        1 like
                        Last Post NinjaTrader_ChristopherJ  
                        Started by frankthearm, Today, 09:08 AM
                        5 responses
                        22 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Working...
                        X