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

Paint previous bar

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

    Paint previous bar

    Hi, I want to paint the previous bar blue if the following is met

    High[0] < High[1]
    High[1] > High[2]

    The previous bar in this case would be High[1]
    Very simple but the strategy builder doesn't let me paint the previous bar

    #2
    Hello Ousher,

    Thanks for your post.

    Correct, you can only set the current bar color in the Strategy Builder.

    There are other drawing options in the strategy builder that allow you to reference a "Bars ago", for example you can draw a marker (Arrow, dot, triangle, etc) or a vertical line, or text.

    Here is a short video on how to use draw markers: https://paul-ninjatrader.tinytake.co...MF8xMTMwNTc0MA

    To color a previous bar, you would need to unlock your strategy and work directly in Ninjascript and use the BarBrushes[] method where you can specify a bars ago value.
    Reference: https://ninjatrader.com/support/help...barbrushes.htm





    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Doing something similar with an indicator that is calculated onbarclose

      but for a alert they are sending sound file intrabar using the below

      soundBar = CurrentBar;

      i wish to modify and send after the bar close, what do i replace CurrentBar with

      thanks

      Comment


        #4
        Hello DTSSTS,

        Thanks for your post.

        I am not sure I understand how this relates to the topic subject of "Paint previous bar".

        You state, "Doing something similar with an indicator that is calculated onbarclose"

        Can you elaborate on what you mean by "sending sound file intrabar"? Where is the file being sent?

        Are you working in Ninjascript or in the Strategy Builder?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          soundBar = CurrentBar;

          simply wish to know what to change currentbar to for it to be 1barago

          thanks

          Comment


            #6
            Hello DTSSTS,

            Thanks for your reply.

            You can use: soundBar = CurrentBar - 1;
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              thank you agiain

              Comment


                #8
                I am failing to simply paint a dot swing bars ago after watching this video & using the following command: Draw.Dot(this, @"SwingRetouches Dot_1 " + Convert.ToString(5), true, 5, Swing1.SwingHigh[5], Brushes.Red);
                Can someone show me my mistake? thanks
                Attached Files

                Comment


                  #9
                  Apologies the last attachment was assembled. This attachment is source. Simply trying to paint a bar, strength bars ago, when a new swing is put in thanks!
                  Attached Files

                  Comment


                    #10
                    got it figured out... attached
                    Attached Files

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by maybeimnotrader, Yesterday, 05:46 PM
                    3 responses
                    23 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by adeelshahzad, Today, 03:54 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by stafe, 04-15-2024, 08:34 PM
                    7 responses
                    32 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by merzo, 06-25-2023, 02:19 AM
                    10 responses
                    823 views
                    1 like
                    Last Post NinjaTrader_ChristopherJ  
                    Started by frankthearm, Today, 09:08 AM
                    5 responses
                    23 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Working...
                    X