Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing an object on the following bar?

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

    Drawing an object on the following bar?

    Hello I am new so bear with me. I am confused on how to apply a drawing to the next bar... is something like this not possible? Thanks.

    if (Close[-1] > Close[0])

    {Draw.Diamond(...



    #2
    try if(Close[1]>Close[0]), your code...

    below is draw......
    { // Instantiates a red diamond on the current bar 1 tick below the low
    Diamond myDiamond = Draw.Diamond(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Red);

    // Set the area fill color to Red
    myDiamond.AreaBrush = Brushes.Red; }

    Comment


      #3
      Thank you for your reply Emma, I'm not confused about how to draw the actual diamond... My issue is that I want to draw something on the bar after the current bar. Using close[1] would draw something on the previous bar, but using a negative value such as Close[-1] (for a future bar) doesn't appear to be working. I was wondering if there was a workaround this or something else that I might be missing here.
      Last edited by augustfay; 07-18-2020, 03:56 PM.

      Comment


        #4
        Hello augustfay,

        Unfortunately, negative indexes are not supported.

        Instead, Emma1 is suggesting that you check the previous bar once a new bar has formed to see if that previous bar was a trigger bar and if a drawing object needs to appear on this new bar.

        It's not drawn in the future, its drawn the moment the new bar exists and the bar before it was a trigger bar.


        Alternatively, you can custom render anything you would like on the chart within the renderable area.
        The SampleCustomRender included with NinjaTrader demonstrates custom rendering.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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