• 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
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tonynt, Today, 10:47 AM
    0 responses
    1 view
    0 likes
    Last Post tonynt
    by tonynt
     
    Started by Bionian, Today, 10:10 AM
    1 response
    4 views
    0 likes
    Last Post Emma1
    by Emma1
     
    Started by sgordet, Today, 10:01 AM
    0 responses
    1 view
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by D Trader, Today, 09:43 AM
    0 responses
    4 views
    0 likes
    Last Post D Trader  
    Started by rafaelabe1977, Today, 03:51 AM
    1 response
    10 views
    0 likes
    Last Post sledge
    by sledge
     
    Working...
    X