mq4 script that will return the profit of the latest trade

 

I am developing an EA based on the breakout. Manually, i will placed the two horizontal lines on the mt4 chart and when the price crosses that horizontal line it will automatically open trades. But, I wanting that if the trade is closed it will automatically delete that two horizontal lines on the chart because sometimes the price changes direction and when the lines is present it will open trades again. So, I am humbly asking your help if you can help me making that script. 

Maybe it will delete the lines if the last trade has positive profit. 

Thank you very much and God Bless you more

Nieco Pama

 

As it is a break-out strategy, you may want to delete the line that gets broken when you open the trade and leave the other ( if you want the trade closed and the opposite trade opened if price reverses).

Then delete the other line if the first trade hits TP.

The other option is to change the name of the lines in the code when a trade is opened so that the EA will no longer work with them (Assuming that the EA is coded to work with specifically named lines).


In future please post in the correct section

I will move your topic to the MQL4 and Metatrader 4 section.

 
Nieco Pama:

I am developing … I wanting … I am humbly asking your help if you can help me making that script.

You are developing what? Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

Reason: