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

Drawing horizontal lines above/below price

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

    Drawing horizontal lines above/below price

    Hey traders,

    How would I go about developing a strategy that would draw a horizontal line at a certain amount of ticks above or below the current price, that moves/trails along with the price? I've played with the Strategy builder quite a bit and searched through the forums but couldn't come up with anything. To be even more specific, I'm using Renko bars, and would like to draw a horizontal line at a predefined amount of ticks above the current bar when the price is falling, and below the bars when the price is rising. Example, if I have a Renko bar that is set at 55 ticks, and the price is rising (the bars are green), I would want a horizontal line at precisely -55 ticks below the low of the current bar, and vise versa, Renko bar falling (red bars) with a horizontal line at +55 above the high of the current bar. In this example, the 55 tick above or below would be the point at when the Bars would reverse and print. That's about as clear as I can be about that. Hope this makes sense and any help would be much appreciated. Is this something that I can build with the strategy builder or does this require coding? If it's something I need to code then I'm poop out of luck. Thanks!

    #2
    Hello Sh00tHerMcGavin,

    In the Condition builder select Misc > Falling on the left, Equals in the center, and Misc > True on the right. (Falling will also be in the Misc section for the reverse condition)
    For the action select Drawing > Horizontal Line > Click set for the Y value > select Price > select Close, in the Offset select Ticks from the drop-down, type -55 in the value input field above.

    Below I am also including a public link to a video that explores the tools available in the Strategy Builder.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      It worked! Thank you ChelseaB! I was doing it the other way around, with True on the left = Rising/Falling on the right. Works like a charm, much appreciated.

      Comment


        #4

        Hello, I wonder if there is any way through the strategy builder or some indicator to draw lines above and below the current price, at the distance of ticks that I want.
        This will help me to visualize in an easy way the distance of my stop at the current price, and thus I would decide very quickly whether to execute the trade or not.

        For example:

        Let's say I trade the NQ, and I have an ATM with a stop at 45 ticks.

        Well, I want to see on the chart, a line above and another below the current price, both 45 ticks away and accompanying the price, so that they are always 45 ticks away.In this way, I see very quickly and visually where my stop will be if I execute a trade.

        Is there such a thing?

        Thank you.

        Comment


          #5
          Hello pekex,

          Yes, you can draw two lines, one with the start y at the High[0] and end y at the High[0] + number of ticks above the high * TickSize, and the other with the start y at the Low[0] - number of ticks below the low * TickSize and end y at the Low[0].
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6





            Where do I begin? I have never used the strategy builder!



            Comment


              #7
              Hello pekex,

              Below is a link to a forum post with helpful information about getting started with NinjaScript.


              I recommend you watch the Strategy Builder 301 video several times until you have learned how to use the Strategy Builder.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Johnny Santiago, 10-11-2019, 09:21 AM
              95 responses
              6,193 views
              0 likes
              Last Post xiinteractive  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              2 responses
              11 views
              0 likes
              Last Post xiinteractive  
              Started by Irukandji, Today, 09:34 AM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by RubenCazorla, Today, 09:07 AM
              1 response
              5 views
              0 likes
              Last Post RubenCazorla  
              Started by TraderBCL, Today, 04:38 AM
              3 responses
              25 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X