Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Seneca, 08-25-2020, 08:31 AM
        3 responses
        5,946 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Tradereh2020, Today, 06:29 AM
        0 responses
        3 views
        0 likes
        Last Post Tradereh2020  
        Started by slightly, Today, 12:49 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by casabella, Today, 04:12 AM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by ETFVoyageur, Today, 05:50 AM
        0 responses
        6 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X