• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access indicator plot colors

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

    Access indicator plot colors

    hi, say I have an indicator that plots a line and colors it blue and red.
    I want to access the plot colors from another indicator and do something like this:

    Code:
    MyIndicator ind = MyIndicator();
    byte red = ind.PlotColors[0][0].R;
    byte green = ind.PlotColors[0][0].G;
    byte blue = ind.PlotColors[0][0].B;
    I get 0's in red, green and blue though Plot 0 gets assigned different colors.
    Should this work?

    #2
    Just answering it here for others as I got it working.

    Need to call MyIndicator.Update() before accessing PlotColors

    So code should look like this:

    Code:
    MyIndicator ind = MyIndicator();
    
    ind.Update();
    
     byte red = ind.PlotColors[0][0].R; 
    byte green = ind.PlotColors[0][0].G; 
    byte blue = ind.PlotColors[0][0].B;

    Comment


      #3
      Thanks for sharing your update and solution here onnb1.
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by darkgreen, Today, 09:36 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by JuanPabloQuevedo, Today, 01:04 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Tyler  
      Started by augustfay, Today, 10:46 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by neilzep, Today, 11:16 AM
      3 responses
      19 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by thebanik, Today, 10:18 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Working...
      X