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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    69 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    312 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    306 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    146 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    106 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X