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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        73 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        152 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X