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

Set plot color equal to other plot color

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

    Set plot color equal to other plot color

    Scenario:

    I want to set a plot color equal to another plots color. I tried "PlotBrushes[LineNumber + PlotOffset][0] = PlotBrushes[0][0] ;//Use override color" but doesn't do anything.
    I used to do this in Ninja 7 all the time but seem to have an issue on Nina 8.

    Question:

    I am thinking it is a syntax issue on Ninja 8. What is the correct syntax to set one plots color equal to another plot?

    Cheers

    #2
    Are you trying to set the plot's overall color e.g. permanently for all bars to another plot's overall color? Or, are you trying to copy the overridden color of an individual bar from one plot to another? If you mean for that individual bar, you can do something like PlotBrushes[2][0] = PlotBrushes[0][0]; which would copy plot index #0's color to plot index Forum for the current bar. If you mean in general, those are properties of the Plots[] object e.g. Plots[2].Brush; but those are set up "once and for all" when the plot is configured.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello ct,

      Thanks for your post.

      QuantKey_Bruce is correct. To change the color of an individual bar you may use PlotBrushes[int PlotIndex][int barsAgo] as QuantKey_Bruce explained.

      The code might look something like PlotBrushes[1][0] = PlotBrushes[0][0];.

      Plots[int index].Brush would be used to change the color of the entire plot series.

      An example of this would be Plots[0].Brush = Brushes.Green;

      See the help guide pages below for more information and sample code.

      PlotBrushes: https://ninjatrader.com/support/help...lotbrushes.htm
      Plots: https://ninjatrader.com/support/help.../nt8/plots.htm

      Please let me know if I may assist further.

      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by guillembm, Yesterday, 11:25 AM
      2 responses
      9 views
      0 likes
      Last Post guillembm  
      Started by junkone, 04-21-2024, 07:17 AM
      9 responses
      68 views
      0 likes
      Last Post jeronymite  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      4 responses
      18 views
      0 likes
      Last Post trilliantrader  
      Started by mgco4you, Yesterday, 09:46 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by wzgy0920, Yesterday, 09:53 PM
      0 responses
      10 views
      0 likes
      Last Post wzgy0920  
      Working...
      X