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

get color from a plot in 3rd indicator

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

    get color from a plot in 3rd indicator

    Hi guys, I'm creating a strategy that uses an indicator that wasn't created by me, this indicator has 2 lines, I can read the value of these lines without problems, but one of them changes color in certain situations and I need to read this change of color to complement my decision making. but I can not. The best I could do was read the contents of .Plots(0).brush, but it only reflects the initial color and does not contain the changes. When I open the DataBOX window, I see the values of each indicator line, and each line "in the databox window" is painted in the correct color according to the bar that the mouse is within the graph. Can anyone help ​me read this color, or this is not possible. thank you all.


    #2
    Have you tried reading SomeIndicator.PlotBrushes[x][0] where x is the plot number? If [0] is always unset, try reading [1] if the strategy is intrabar - perhaps the indicator only updates on bar close.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello afsnews,

      Thanks for your post.

      There are no supported or documented means for checking if the brush color of a third-party indicator's plot is a specific brush color for conditions.

      Are you able to modify the third-party indicator?

      If so, you could add public exposed variable to the indicator, set the variable to 1 when the plot changes to one color and set the variable to -1 when the plot changes to the other color. Then, in your strategy you could create a condition that checks if the variable is equal to 1 or -1 to determine the color of the plot.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by QuantKey_Bruce View Post
        Have you tried reading SomeIndicator.PlotBrushes[x][0] where x is the plot number? If [0] is always unset, try reading [1] if the strategy is intrabar - perhaps the indicator only updates on bar close.
        hi, yes i've tried this. PlotBrush doesnt work, and .Plots(0).brush wotk, but it dont show correct values, it only shows the value of the start config. tnks a lot

        Comment


          #5


          Hi, unfortunately I don't have access to the indicator's source code, but I managed to contact the developer and asked for exactly what you suggested. I asked him to put an exposed variable, which reflects something like: 1= green, 2 = red, 3=yellow, etc. Thank you for your attention.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,403 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          95 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          7 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          159 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          8 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X