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

DrawText Question

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

    DrawText Question

    Hello,
    This currently plots the "<" on or in line with price. Can this code be edited to plot the "<" in line with an SMA for example, instead of price? If so, what change would I make?


    //DrawText("Closemarker", false, " " +"<", 0, Close[0] ,Color.LimeGreen, txtFont, StringAlignment.Near, Color.Green, Color.Green, 2);

    Thanks

    #2
    Have the y-axis value close to your SMA and it will plot around your SMA.

    If your SMA is in another panel, add DrawOnPricePanel = false to your indicator's Initialize() method. Then make sure to add the indicator to the same panel as the SMA.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      replace Close[0] with SMA(Close, AverageLength)[0]

      Comment


        #4
        Great Thanks, Got it.

        Is there away to plot the current value of say the CCI or other, in the place of the "<" ?
        So in its place would be the CCI's current value like "95" or "-95" ?

        Thanks

        Comment


          #5
          Call the CCI indicator and then just do .ToString() to make it a string. Remember that this is not going to be a dynamically changing CCI value. It will just be the CCI at any given point in time.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            DrawText("Closemarker", false, " " +"< " + CCI(14)[0].ToString("0.0"), 0, SMA(AverageLength)[0] ,Color.LimeGreen, txtFont, StringAlignment.Near, Color.Green, Color.Green, 2);
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              Thanks for your help guys. Got it.

              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by kujista, Today, 06:23 AM
              0 responses
              1 view
              0 likes
              Last Post kujista
              by kujista
               
              Started by traderqz, Yesterday, 04:32 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by f.saeidi, Today, 05:56 AM
              1 response
              4 views
              0 likes
              Last Post Jltarrau  
              Started by Jltarrau, Today, 05:57 AM
              0 responses
              4 views
              0 likes
              Last Post Jltarrau  
              Started by Stanfillirenfro, Yesterday, 09:19 AM
              7 responses
              53 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X