Hi Funyoo,
Attached is the trendmeleaveme3.mq4 EA developed by Waddah Attar a few years back, and modified by folks at Forex-Tsd TrendMeLeaveMe - Forex-TSD
It makes a trade when a manually applied trendline (using '/' on the Mt4 menu bar) is broken. I find it very useful for setting up for potential trades overnight or when I can't be at my desk. Trendline breaks are a simple and effective way to take pips from the market, and with trendmeleaveme you can apply tight stops and profit targets.
Problem with this EA is that it will not make just one trade, but will open trades whenever the trendline is hit, so if after the initial trend break produces a trade, another trade will open if the market price comes back to the trend line! For some overnight sessions I've had up to 10 trades take place as the market meandered back and forth along the trend line.
So, my request is, can you change the EA so that it only makes a single trade for each trendline. I'm thinking that maybe the trendline name (in properties) can be changed to something other than the trigger name ('buystop' and 'sellstop') once a trade is in place and the sl and tp are submitted. Either that or just have the EA delete the trend line so it isn't visible to the EA anymore.
Hope you can help, thanks as always.