Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator line color control ...

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

    indicator line color control ...

    I'm back testing a strategy using the Strategy Analyzer, but have been having problems making my indicator lines change color based on conditions.
    The initial color definitions for the lines are working.

    protectedoverridevoid Initialize()
    {
    EMA(EMA1).Plots[0].Pen.Color = Color.Linen;
    EMA(EMA2).Plots[
    0].Pen.Color = Color.Red;

    Add(EMA(EMA1));
    Add(EMA(EMA2));

    CalculateOnBarClose =
    true;
    }
    protectedoverridevoid OnBarUpdate()
    {
    // EMA1 color control
    if ((Falling(EMA(EMA1)) == true) && (EMA(EMA1)[0] < EMA(EMA2)[0]))
    {
    EMA(EMA1).PlotColors[
    0][0] = Color.Red;
    }
    elseif ((Rising(EMA(EMA1)) == true) && (EMA(EMA1)[0] > EMA(EMA2)[0]))
    {
    EMA(EMA1).PlotColors[
    0][0] = Color.Lime;
    }
    elseif ((Falling(EMA(EMA1)) == true) && (EMA(EMA1)[0] > EMA(EMA2)[0]))
    {
    EMA(EMA1).PlotColors[
    0][0] = Color.Yellow;
    }

    #2
    Hello TJ,

    The reason for this is that the plotting is limited with the Strategy Analyzer since it is not a full chart being used.

    This will work on a live chart without issue.

    If you need to see these colors in a backtest then you would need to create an indicator using the EMA Calculations and change the plot colors from the called indicator.

    http://www.ninjatrader.com/support/f...ead.php?t=6651

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      have connected o live data feed, charting of live data is working, but when I select this strategy, the coloring of the indicators is not working. Strategy is selected After the chart is up .. but does not change any indicator colors.
      Am I missing some type of Plot setup or something ??
      Or do I have to create my indicators .. then control the color ??
      Trying to use available EMA lines ...

      Comment


        #4
        Tj.Wheeler,

        Can you please send me your script so that I can review what you have written at this point?
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Taddypole, Today, 02:47 PM
        0 responses
        0 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        50 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        398 views
        1 like
        Last Post beobast
        by beobast
         
        Started by lorem, Yesterday, 09:18 AM
        5 responses
        22 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by WHICKED, Today, 12:56 PM
        2 responses
        15 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Working...
        X