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

Multicolor Indicator that is Not an Oscillator

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

    Multicolor Indicator that is Not an Oscillator

    Other posts here explain how to plot an indicator with changing color using a threshold ( Plots[0].Min / Plots.[1].Max ). I want to color my indicator depending on whether it is above or below current price, and resetting the threshold to current price means the color change point moves for historical bars.

    Using a simple-

    if (myIndicator > Close[0])
    MyIndicatorAbove.Set(myIndicator);
    else
    MyIndicatorBelow.Set(myIndicator);

    will work using Plot Style of Dot, but if I use Line then I get a gap at each color change.

    I think I need to force the new color plot to start from the end of the previous bar, rather than the current bar onwards. I also think I have seen a solution here before, but can't find it now (maybe that was a dream!!).

    Is there a simple solution to this, so that I can use a Line rather than a Dot to plot my indicator?

    #2
    See the following thread, post #2.

    RayNinjaTrader Customer Service

    Comment


      #3
      Thank you Ray, that is exactly what I was looking for.

      Comment


        #4
        This creates 3 entries in the databox, one for each color. At any one time, two of the fields are empty and one contains the data value.
        What would be desirable is a way to display just one thing in the databox, that always has the correct data.
        Is there a way to program this please? I suspect there is because I have seen it in other people's indicators. (Proprietary and unbrowsable, so I can't just go inside and look how they did it.)
        Thanks,
        saltminer

        Comment


          #5
          saltminer,

          Unfortunately other approaches are currently not supported.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elderan, Yesterday, 08:03 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by samish18, Yesterday, 08:57 AM
          8 responses
          25 views
          0 likes
          Last Post samish18  
          Started by DJ888, 04-16-2024, 06:09 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by RookieTrader, Today, 07:41 AM
          0 responses
          3 views
          0 likes
          Last Post RookieTrader  
          Started by maybeimnotrader, Yesterday, 05:46 PM
          1 response
          19 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X