• 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

Question adding an indicator to a Chart

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

    Question adding an indicator to a Chart

    Hello,

    I know that I can add an indicator to a chart using the next method inside DataLoaded state:

    AddChartIndicator(SMA(20));

    My question is, what is the fastest way of changing the default color of that indicator?

    Can I do that adding a line code like we used to do with NinjaTrader 7? Something like this: SMA(20).Plots[0].Pen.Color = Color.Blue;

    Or do I need to create an object of the class SMA and after that customize the object as is shown in the SampleMACrossOver strategy for NT8?

    Any shortcut?

    Thanks.

    #2
    Hello Plaket,
    Thanks for your post.

    You would want to set the Brush of the plot by doing something similar to the following:
    Code:
    else if (State == State.DataLoaded)
    {
        SMA(20).Plots[0].Brush = Brushes.Red;
        AddChartIndicator(SMA(20));
    }
    Please see the following link for more information on adding indicators to strategies: https://ninjatrader.com/support/help..._strategie.htm
    JoshNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by saeed, Today, 02:07 PM
    2 responses
    5 views
    0 likes
    Last Post saeed
    by saeed
     
    Started by 7robert, Today, 01:40 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by bortz, Today, 12:57 PM
    2 responses
    16 views
    0 likes
    Last Post bortz
    by bortz
     
    Started by richa61416, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Robotman, Today, 01:08 PM
    0 responses
    6 views
    0 likes
    Last Post Robotman  
    Working...
    X