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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X