• 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 tgn55, Today, 07:22 AM
    0 responses
    2 views
    0 likes
    Last Post tgn55
    by tgn55
     
    Started by U0000999, Today, 05:17 AM
    0 responses
    4 views
    0 likes
    Last Post U0000999  
    Started by Prataturry89, Today, 03:40 AM
    0 responses
    5 views
    0 likes
    Last Post Prataturry89  
    Started by UltraFastKetoBoost28, Today, 02:43 AM
    0 responses
    6 views
    0 likes
    Last Post UltraFastKetoBoost28  
    Started by kojakojids, Today, 02:04 AM
    0 responses
    5 views
    0 likes
    Last Post kojakojids  
    Working...
    X