Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

highlight one bar per setup

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

    highlight one bar per setup

    Hello Ninjatrader community,

    How can I only highlight a particular red bar per setup? I'm looking to highlight the first red bar per setup in strategy builder and need help in just separating it from all other red bars that show up in the setup. So in other words don't highlight the 2nd red bar, 3rd, 4th etc...only the 1st red bar. I've included a pic for demonstration purposes. The bars with the green tick is the first red bar in the setup which I would like to be only highlighted and the ones with the red Xs are the ones I don't want highlighted per setup.

    Thank you
    Titli
    Attached Files

    #2
    Hello Titli,

    When you state "only highlight a particular red bar per setup", what do you mean by per setup?

    By "setup" do you mean when a condition is true?

    In the Strategy Builder, in the 'Do the following' add an action -> select Drawing -> select Set bar color.

    This is shown in the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video. I highly recommend reviewing this again.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello ChelseaB,

      By "setup" I do mean when a condition is true. In my example when the bars crossed over the orange line I want to only highlight the first red bar and not any other red bar that follows after, until setup becomes true again(crosses below blue line and than above orange line) . I just want to isolate that bar.

      Comment


        #4
        Hello Titli,

        Yes, use 'Set bar color' to set the bar color when your condition is true.

        Code:
        I just want to isolate that bar.
        Are you asking how to write the logic?

        Or do you know the logic and need help selecting the objects in the condition builder?


        What are the specific rules?

        When the Close price crosses above an indicator plot, color the bar?

        (A cross above would not happen until the series cross back below so that they can cross above..)
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Yes, I need help in writing the logic. The specific rule is once the bars start closing above the orange line highlight only the first red bar that has closed above the orange line.

          Comment


            #6
            Hello Titli,

            I'm not certain but it sounds like you are describing a normal cross above..

            Try selecting on the left Price -> Close, in the center Cross above, on the right Indicator -> (whichever indicator you have on your chart)

            For the action select 'Set bar color'
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I think I might not have been clear with what I'm trying to achieve. I ONLY want the 1st red bar above the crossover to be highlighted and I don't know how to isolate the 1st red bar from the other red bars that form afterwards during the crossover. Is there a way to only isolate(highlight) one red bar in a setup from the other red bars in the strategy builder?

              Comment


                #8
                Hello Titli,

                This would color the first bar on the cross.

                If you wanted to set a trigger for the cross to happen and then after this the first bar where the close is less than the open, you can use a bool for this.

                Add a bool variable.

                In the first condition set add no conditions.

                In the second condition set compare the Close to be crossing above the indicator plot.
                Set the bool to true.

                In the third condition set compare the Close to be less than the Open.
                Set the bool to false.
                Also set the bar color.

                (edit, forgot to include a link to an example)
                An example can be found on the forum linked below.
                Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder
                Last edited by NinjaTrader_ChelseaB; 11-07-2022, 01:35 PM.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Wow, ChelseaB you are awesome! I'm understanding your logic. I would appreciate if you can share some pics of how you would accomplish this in strategy builder. You can use an ema as an example.

                  Comment


                    #10
                    Hello Titli,

                    I've added a link to an example in my post above.

                    Let me know if you need me to take screenshots of the example opened up in the Strategy Builder.
                    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
                    635 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    365 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    106 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    567 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    571 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X