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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    153 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    305 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X