Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple color indicator help

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

    multiple color indicator help

    Can anyone tell my why the following will not work? I'm just trying to figure out how to set up a histogram with one color for a descending line and another color for an ascending line. It will eventually be a formula, but just to get things started.

    The way I did it below, it only draws the second plot, and it omits the first plot;

    privatedouble LongSum = 0;
    privatedouble ShortSum = 0;

    protectedoverridevoid OnBarUpdate()
    {
    if(CurrentBar < 21)return;
    LongSum = SMA(8)[0];
    ShortSum = SMA(
    13)[0];
    if(LongSum > ShortSum)
    {
    Plot1.Set(LongSum-ShortSum);
    }
    else
    {
    Plot0.Set(LongSum-ShortSum);
    }
    }

    #2
    Hello,

    In this post I am assuming the 'one plot' is correct and the other plot is correct if it were plotting at all.

    Your issue is probably in adding the plots. For an example on how it works look at the code of an existing indicator with two plots or build a two plot indicator in the Strategy Wizard and look at that code.
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    625 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X