Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delete rectangle when the price closes below or above it

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

    Delete rectangle when the price closes below or above it

    Hello, good to everyone.
    I have no idea of ​​programming. But I do some basic things with the Strategy Builder. I have managed to get the indicator to detect a specific candle pattern and draw a rectangle for me as a zone.
    I would like those rectangles to be erased when the price closes below them if it is bullish or above them if it is bearish. Right now he draws me at a fixed number of candles. All the rectangles measure the same.I would really appreciate any kind of help.

    #2
    Hello tabi5, thanks for your post.

    You will need to save the price where you draw the rectangle then evaluate if the Close[0] goes above or below that price. You can set up a double variable in the Inputs and Variables section for saving the value. In a new set, check if the Close[0] price crossed above or below that variable.

    Kind regards,
    -ChrisL

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hello tabi5, thanks for your post.

      You will need to save the price where you draw the rectangle then evaluate if the Close[0] goes above or below that price. You can set up a double variable in the Inputs and Variables section for saving the value. In a new set, check if the Close[0] price crossed above or below that variable.

      Kind regards,
      -ChrisL
      I really appreciate your answer ... But as I said at the beginning I don't understand much. Could you help me understand how I save those prices where the rectangle was drawn?

      Comment


        #4
        Hello tabi5, thanks for your reply.

        First, you will need to make a variable in the Inputs and Variables tab. Then, in the condition set where the rectangle is drawn, along with drawing the rectangle, save the value using the same price you used to draw the rectangle. After this, you would check in a different set if the current close price crossed above or below that saved value. If practice with condition building is needed, we have a full set of examples here:
        https://ninjatrader.com/support/help...on_builder.htm

        Kind regards,
        -ChrisL

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X