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

A little help for ChartIndicators please

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

    A little help for ChartIndicators please

    Hey fellas -

    This is likely a simple question but I don't have the skill level to find the answer so I could use some help.

    I have a custom Ichimoku Cloud indicator for my strategy and I've figured out to change the Plots Colors using ChartIndicator. However, there's some other settings that aren't plots and I'm not sure how to set those values.

    Specifically, those ones under the 'General' area of the attached screenshot like Opacity and UpCloudBrush line color, etc.

    When I look at the code for the indicator (IchimokuSignal.cs), it looks like those brushes are referenced using the Direct2D1 object?

    private SharpDX.Direct2D1.Brush upAreaBrushDx, dnAreaBrushDx, upLineBrushDx, dnLineBrushDx, textBrushDx;

    Can you help?
    Attached Files

    #2
    Hello PN720,

    Thank you for the post.

    Because you have the source code and you have the ability to see what the property name is in the GUI, you should be able to deduce any of the properties needed from what you have provided. In addition because you are using ChartIndicator you would need to Cast the found indicator to the correct type.

    Looking at the image, if you wanted the "UpCloudBrush line color" the easiest way to locate the Variable for this would be to search (control + f) in the NinjaScript file for "UpCloudBrush".

    This leads to the following public property:

    Code:
    #region Properties
    
    ...
    
    [XmlIgnore]
    [Display(ResourceType = typeof(Custom.Resource), Name = [B]"UpCloudBrush line color"[/B], Order=4, GroupName = "NinjaScriptGeneral")]
    public Brush [B]UpLineBrush[/B]
    {
    	get { return upLineBrush; }
    	set { upLineBrush = value; }
    }

    UpLineBrush is the variable name, so the ChartIndciator would likely look like:

    Code:
    IchimokuSignal myIchimokuSignal		= (IchimokuSignal)ChartIndicators[0];
    myIchimokuSignal.UpLineBrush = Brushes.Red;
    Using the names you can see in the user interface will allow you to pick out any of the needed properties, All of the properties should be near the bottom of the file in the #Region Properties area.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Just what I need, thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by algospoke, Yesterday, 06:40 PM
      2 responses
      19 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      44 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      20 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      180 views
      0 likes
      Last Post jeronymite  
      Working...
      X