Strategy for: Do Not Trade Inside Chart Rectangle
-
Hi guys,
I have a EA that draws Resistance / Suport lines on my charts and Draw rectangles around it based on ATR. I call these rectangles "no trade zones", which means that I don't want any trades to be opened near these lines.
But I can't find a way to tell my EA to not trade inside the rectangles... does anyone know how to do it?
-
use 2 conditions , price is below the upper line and price is above the lower line , connect that to an and block and there you have it

-
@timmyhanke thanks for the reply.
The problem is that there can be several lines and rectangles. The rectangles are dynamically created and deleted, so I name them with a prefix so they can be select.
I have to dynamically select the object by the name prefix (object in loop) to compare current price to the low and high of each rectangle. This must be done to all rectangles on the chart.
... I was trying to use a boolean variable (true/false) to Enable and Disable trades, but it was getting too complicated.
Thinking about the AND block, I could use it directly on my buy/sell strategies. If we had a NAND block it would be perfect. Do you know if we can "make" a NAND or a NOT block? That would solve the question.
EDIT: Alright, I figured it out. Thanks for the help timmy!
-
sure that you figured it out ? beacuse what i know you will have a line above everything and a line below evertything , based on your knowlage and your risktaking, so to make a condition that are between those meaning < high and > low and connect that to an and block and use that as a filter and add that to your buy/sell conditions , and drag the and yellow dot to continue your jouney , meaning if its not between those two lines , in your case that the market isnt raging .