Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator that measures distance from EMA of current candle

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

    #16
    Thank you.

    Changed to this and now once I let it start moving after setting the time in Playback it does properly autoscale.
    Code:
    Draw.Text(this, "test"+(CurrentBar), true, EMAChange.ToString("0"+"%"), 0, (Low[0] + (High[1]-Low[1])*1.5), 0, TextColor1, new SimpleFont ("Arial",13), TextAlignment.Center, TextColorTrans,TextColorTrans,100);
    Is there is a way to make the box around the text transparent?
    Last edited by WeyldFalcon; 02-05-2021, 09:47 AM.

    Comment


      #17
      Hello WeyldFalcon,

      Thanks for your reply.

      I've created a short video to demonstrate, using the Draw.Text() example, how the autoscale is working as well as answer your question about the box.


      Comment


        #18
        Awesome thank you so much! I got it working and with no box! at least not one we can see

        Comment


          #19
          Hello,
          I know this is an older post but I am trying to find out if this indicator would be available for NT8. If not is there a comparable one. Thanks

          Comment


            #20
            How do you get this to show on previous bars instead of just the current bar?

            Comment


              #21
              Hello jwindisch8725,

              Thanks for your notes.

              The code uses the current bar's Close price (Close[0]) and the current bar's EMA value (myEMA[0]) to calculate the TicksAway on the current bar.

              You would need to use the previous bar's Close price (Close[1]) and the previous EMA value (myEMA[1]) when calculating the TicksAway to get the number of ticks away on the previous bar.

              To draw text on the previous bar you should set the "int barsAgo" parameter to 1 when calling the Draw.Text() method.

              Draw.Text(NinjaScriptBase owner, string tag, string text, int barsAgo, double y)

              Draw.Text(): https://ninjatrader.com/support/help.../draw_text.htm
              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment


                #22
                Thank you Brandon, I meant is there a way for the ticks away to show on every bar on a chart. Not just the current or previous bar. For each bar on entire chart.

                Comment


                  #23
                  Hello jwindisch8725,

                  Thanks for your notes.

                  You could supply the Draw.Text() method with a unique tag name for a new draw object to appear on each bar.

                  From the Draw.Text() help guide:

                  tag:
                  A user defined unique id used to reference the draw object.

                  For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.

                  You could use CurrentBar to make the tag name unique, such as passing in "tag" + CurrentBar for the tag parameter of the Draw.Text() method.​
                  <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                  Comment


                    #24
                    Hello : I need to calculate the difference between two EMAs values to be able to take a decision in strategy builder of NT8. I found in this forum the mention to this indicator EMATicksAway , I downloaded the zip file but the is not possible to import it to NT8 it says is an old version. I am not sure if that indicator would help me either cause I do not know how it works.
                    Can anybody share if any way to do mentioned calculation?
                    Many thanks in advance.
                    BR//elepere

                    Comment


                      #25
                      Hello elepere,

                      Welcome to the NinjaTrader forums!

                      In the strategy builder you can use series to do math.
                      You could set the series to the current value of the first indicator, then set the series to itself with the offset set to subtraction and set the offset value set to the second indicator. (However the TickSize is not available in the Strategy Builder to divide by the TickSize)

                      If you would like to post the script, I would be happy to try and re-export this with the latest version so you can import it.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #26
                        Using this indicator, how can I plot a marker on the chart for every time a certain condition is met? For example, plot a marker every time price is 30 ticks away from the EMA. Thank you!

                        Comment


                          #27
                          Hello mkpalmer,

                          Welcome to the NinjaTrader forums!

                          May I have you clarify the specific rules of:

                          "plot a marker every time price is 30 ticks away from the EMA"

                          Are you meaning the current market price (current bar close price) is exactly equal to the EMA plus 30 ticks?

                          Do you mean the close is equal to or greater than the EMA plus 3 ticks?


                          In the condition builder select Price > Close, in the center select Greater equal, on the right select Indicator > SMA, set the Period. In the Offset select Ticks and set the Value to 30.

                          The 'Automate Your Trading with NinjaTrader's Strategy Builder' training video demonstrates using the Strategy Builder.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          599 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          345 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          103 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          558 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          558 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X