Trendline rebound sell/buy EA
-
Hi guys,
I'm tring to create a simple ea that opens buy or sell when the price touches trendline. With an increasing trendline it search for buys only, and conversely with a trendline that goes down it looks only for sells.
I share with you the project because the buy works well, the sell does not.
There is also some kind of "sensibility" to not open buys or sells too far from trendline. Without the sensitbility it works well, so I feel the problem could be in the formula or in how I manage variables for the sell part.
Can someone help me, please?

-
-
Sorry, here's the correct link https://fxdreema.com/shared/YIfZuoc8
-
@pinoa Your EA is looking for two objects picked by name, B and S. However they are not visible in this project. Are they plotted manually maybe? Otherwise you should select objects by loop. That is a much more effective way to detect them.
-
@l-andorrĂ Hi! Thanks for the answer! Yeah, they are plotted manually and nominated accordingly to the input made in the ea. But only the buys works.
-
@pinoa Then the most efficient option is selecting them by loop this way:

-
@l-andorrĂ thank you so much! I'll try it as soon as possibile. So you think the problem was in finding the object, not in the formulas, conditions or whatever...
-
@pinoa Yes. For what I see, your logic is correct. The issue is finding the object.