Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Indicator - Strange Result

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

    Custom Indicator - Strange Result

    I have a custom indicator that uses the following code sample to color specific bars using this.BarColor under specific circumstances ... in 6.5 this works..in 7 the result is strange ... The CANDLE OUTLINE on all subsequent candles is set wrongly to the specified color.

    The inside bar color of the bar that I want to change the color of is set correctly and the following candles inside color seems unaffected (as is correct)... It is only the outline /wick color on the subsequent candles that is effected incorrectly.

    protected override void Initialize()
    {

    ...
    xcolor = Color.Lime;
    mjc_xbar = new DataSeries(this);

    }

    protected override void OnBarUpdate()
    {

    //... code snippet start

    if (High[1] = High[2])
    {
    BarColor = xcolor;
    mjc_xbar.Set(1);
    }

    #2
    I'm not sure why this would be version specific, but the only issue I see is that your if condition is trying to set High[1] to High[2]

    It should read
    Code:
    if(High[1] [B]==[/B] High[2])
    {
    }
    I hope this helps.
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      Thanks mrlogik, could not reproduce here mjc4118 - could you please recheck your bar coloring conditions and retest?

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        Thanks mrlogik, could not reproduce here mjc4118 - could you please recheck your bar coloring conditions and retest?
        The problem is PAINT COLOR, not the if statement that was a mi type mjc_xbar.Set(1); is setting the OUTLINE/WICK color of ALL subsequent candles ...

        I can email this indicator directly so you can see it in 6.5 and see how it PAINTS differently in 7 . It Works FINE in 6.5 I just have no interest in posting all my indicator code and It does paint differently in each version and that is strange.

        Comment


          #5
          mjc4118,

          We would not be interested in the complete indicator logic, just a core example with no frills that demonstrates your issue. Please email us at support[at] ninjatrader[dot] com with "Attn: Josh" and reference this thread with a stripped down, simple-as-possible indicator example that we could test on our end. Thank you.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            mjc4118,

            Thank you for the file. I was able to reproduce.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 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
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X