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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    51 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    31 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    99 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    177 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    170 views
    0 likes
    Last Post CarlTrading  
    Working...
    X