Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

unable to see diamond on chart?

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

    unable to see diamond on chart?

    here is the ninja script . . . just trying to get a diamond on any candle for now . . . when this indicator is added to chart (grid lines disappear) and absence of any diamond?
    so adding this custom indicator is changing the appearance of the chart but way different from the desired result!?!?!?

    protected override void OnBarUpdate()
    {
    if(1 == 1)
    {
    Diamond myDiamond = Draw.Diamond(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Green);
    }
    }
    Attached Files

    #2
    Hello slingonce,

    Thank you for the post.

    I did a quick test of this code and see it working on my end. You mentioned that the grid lines dissipated, That generally won't happen from such a simple indicator so that would hint to me at something else effecting the result.

    Have you tried to manually draw a diamond in this chart and can that be seen?

    The chart you have shown has some items and customization so the next test I would suggest would be to create a new empty chart and make sure to select None for the template. In the new chart manually draw a diamond to make sure you can see it, then apply your script to make sure that shows up as well.

    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse,

      thx so much for the response.

      A) "Has one tried to manually draw a diamond in this chart and that be seen?
      A.1) yes tried to manually draw a diamond
      A.2) yes it can been seen

      Sincerely,
      Malcolm
      Attached Files

      Comment


        #4
        Hi Jesse,

        thx again for the response.

        B) created a new empty chart
        B.1) made sure to select None for the template
        B.2) new chart manually draw a diamond to make sure you can see it . . . did this and it worked
        B.3) then applied my script to make sure that shows up as well . . . did this and it sort of worked . . . it only showed one diamond on the chart . . . should have showed diamond more than once on this chart ? ? ?
        C) changed logic of if statement to be more complicated too . . .

        please advise how to get these green diamonds to show up everywhere on the chart where the below logic applies ? ? ? [assuming logic will be applied to every subset of three candles starting at the far right candle and working all the way back to the left] . . .

        double bar0Low = Low[0];
        double bar0Close = Close[0];
        double bar0Open = Open[0];

        double bar1Low = Low[1];
        double bar1Close = Close[1];

        double bar2Low = Low[2];
        double bar2Close = Close[2];
        double bar2Open = Open[2];

        bool up0candle = (bar0Close > bar0Open);
        bool lowest1candle = (bar1Low < bar0Low);
        bool worf1candle = (bar1Low < bar1Close) | (bar1Low == bar1Close);
        bool dn2candle = (bar2Close < bar2Open) | (bar2Close == bar2Open);
        bool higher2candle = (bar2Low > bar1Low);

        if (worf1candle & lowest1candle & up0candle & higher2candle & dn2candle)
        { // Instantiates a green diamond on the current bar 1 tick below the low
        Diamond myDiamond = Draw.Diamond(this, "tag1", true, 0, Low[0] - (TickSize*7), Brushes.Green);
        }
        Attached Files

        Comment


          #5
          Hello slingonce,
          You're using "tag1" in Draw.Diamond(...) command, replace it with "tag" + CurrentBar, it should work for you.
          Basically, NT8 needs unique tags for all instances of drawing object. tag1 will not change for new object so it replaces the old instance. Just make the tag dynamic by adding CurrentBar (Index number of current bar) so it will draw all instances.
          Hope it helps.

          Comment


            #6
            Hello slingonce,

            s.kinra is correct here, just to add to this the Tag of your object makes that object identifiable. That is used with RemoveDrawObject and for other more advanced uses of finding the object. If a non unique tag is used the existing object is updated and if a new tag is used a new object is drawn.


            https://ninjatrader.com/support/help...t8/drawing.htm (comment about the tag on the bottom of this page)


            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            578 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X