Announcement

Collapse
No announcement yet.

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 = "UpCloudBrush line color", Order=4, GroupName = "NinjaScriptGeneral")]
    public Brush UpLineBrush
    {
    	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 muratb35, Today, 03:36 AM
      0 responses
      3 views
      0 likes
      Last Post muratb35  
      Started by fernlicht, Today, 02:16 AM
      1 response
      9 views
      0 likes
      Last Post NT-Roland  
      Started by fernlicht, 04-12-2021, 06:01 PM
      1 response
      28 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by memonolog, Today, 02:10 AM
      3 responses
      6 views
      0 likes
      Last Post memonolog  
      Started by orenytz, Today, 12:25 AM
      0 responses
      8 views
      0 likes
      Last Post orenytz
      by orenytz
       
      Working...
      X