• 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 Simon Investimens, Today, 03:26 AM
      0 responses
      3 views
      0 likes
      Last Post Simon Investimens  
      Started by EnveousColnago, Yesterday, 06:58 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by owreivmatot, Today, 01:38 AM
      0 responses
      1 view
      0 likes
      Last Post owreivmatot  
      Started by lindsayf, Today, 01:13 AM
      0 responses
      6 views
      0 likes
      Last Post lindsayf  
      Started by thgamey, Yesterday, 06:46 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Working...
      X