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

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.


      Paul H.NinjaTrader Customer Service

      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
              Brandon H.NinjaTrader Customer Service

              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.​
                  Brandon H.NinjaTrader Customer Service

                  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

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by bortz, 11-06-2023, 08:04 AM
                      47 responses
                      1,606 views
                      0 likes
                      Last Post aligator  
                      Started by jaybedreamin, Today, 05:56 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post jaybedreamin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      6 responses
                      19 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      15 views
                      0 likes
                      Last Post Javierw.ok  
                      Working...
                      X