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

Plot a line above or bellow price

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

    Plot a line above or bellow price

    My stops are certain amount of ticks either bellow or above the current price.
    I did that very easily in ninjatrader 7
    If Falling = False ( that means the bars are going up ) then draw a dot on current bar at high-8 ticks.
    Same but opposite for the short stops.

    It works perfect but...

    when I tried to do the same exact thing in ninjatrader 8 it did not work - did not plot anything ( i did enable the strategy ).

    Huge thank you in advance.

    Any idea why ? Click image for larger version

Name:	ES 09-20 (RJay's RenkoSpectrum 4-1)  9_7_2020.jpg
Views:	380
Size:	149.6 KB
ID:	1117237

    #2
    Hello Ben989,

    Thank you for your post.

    Could you supply a code sample of how you're trying to draw the dot?

    Do you receive any errors relating to the script in the Log tab of the Control Center?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you so much.
      I am attaching the ninja 7 working double side strategy and the ninja 8 one thaat does not plot anything
      Attached Files

      Comment


        #4
        I am not getting any errors, it just does not plot anything.
        This is a great strategy for everyone who wants to plot their stops an X amount of ticks either bellow or above the High/Low of the current price.

        Comment


          #5
          Hello Ben989,

          Thank you for your reply.

          I noticed after changing the color of the dot it draws that it did actually plot a single dot - this is because you aren't giving a unique tag to each dot drawn. The NinjaTrader 7 version uses CurrentBar to accomplish this within its tag name and you can do the same in NinjaTrader 8 - add another set to the Tag Name for the Dot that has Misc > CurrentBar set for its value to make each tag unique.

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            Dear Kate
            You are amazing, thank you so much, this is an incredible support.
            I will do what you suggested .
            HUGE THANKS
            Ben

            Comment


              #7
              Hi Kate
              I tried to do what you said but failed, could you please please please elaborate a little more. HUGE THANK YOU in advance.

              Comment


                #8
                Hello Ben989,

                Thank you for your reply.

                Sure! You'd want to adjust the Tag field for your dot drawing object to look like this:

                Click image for larger version

Name:	2020-09-28_07-08-26.png
Views:	212
Size:	12.5 KB
ID:	1120139

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Kate
                  Thank you so much, Your support is incredible- I will do that later today- this is a huge help.
                  HUGE THANK YOU.

                  Comment


                    #10
                    Hi Kate
                    I did what you suggested but still dont get the dots- any idea what am i doing wrong ?

                    Thanks again

                    Ben
                    Attached Files

                    Comment


                      #11
                      Hello Ben989,

                      Thank you for your reply.

                      You've exported this as a compiled assembly, so I'm unable to view your code. Please try exporting again, making sure not to check the "Export as a Compiled Assembly" box, then attach the resulting .zip file to your reply.

                      Thanks in advance; I look forward to assisting you further.
                      Kate W.NinjaTrader Customer Service

                      Comment


                        #12
                        so sorry-
                        i noticed that i am getting only 1 dot instead of a dot for every bar, also the location is wrong- i put 8 ticks bellow the current bar high and it plots one dot somewhere lol.
                        Again Huge Thanks
                        Attached Files

                        Comment


                          #13
                          Hello Ben989,

                          Thank you for your reply.

                          You've just typed in CurrentBar[0] into the field. You need to click the Set button on the right of the field and select Current Bar from the Misc folder.

                          From what I can see they do look like they're plotting in the proper place, however - to do 8 ticks below, you'd need to set it to -8 ticks from the current high.

                          Please let us know if we may be of further assistance to you.
                          Kate W.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks again Kate- do it all but still no dots - no idea why- it was so easy on ninja 7 took me a minute, sorry for all the bothering but would not be able to do that without your help.
                            here is the updated version- where i chose currentbar[0] from the drop down menu and put -8 ticks at the Y.
                            Attached Files

                            Comment


                              #15
                              Hello Ben989,

                              Thank you for your reply.

                              The dots were actually plotting, you just had it set to be the High[0] + (High[0] + (-8 * TickSize)) for the offset, so they were plotting outside the viewable bounds of the screen. I've corrected that and they should plot 8 ticks below the bar high now.

                              Please let us know if we may be of further assistance to you.
                              Attached Files
                              Kate W.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ScottWalsh, Today, 04:29 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              2 responses
                              21 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by tsantospinto, 04-12-2024, 07:04 PM
                              5 responses
                              69 views
                              0 likes
                              Last Post tsantospinto  
                              Started by cre8able, Today, 03:20 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post cre8able  
                              Started by Fran888, 02-16-2024, 10:48 AM
                              3 responses
                              49 views
                              0 likes
                              Last Post Sam2515
                              by Sam2515
                               
                              Working...
                              X