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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    163 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X