I have a custom indicator that gives sell and buy alerts.
I want to convert it to EA that convert these alerts into orders as follows:
1) when a buy signals comes, it closes the sell order and opens a buy order.
2) when a sell signal comes , it closes the buy order and open a sell order.
Depending on these two rules above:
1) The maximum opened orders at the same time is always only one trade for each paper that the EA works.
2) there is always a trade opened.
3) I have to be able to set a default lot size to the orders.
4) I have to be able to set money management as i wish.
Note : when the EA is launched it must check if there is order opened or not, to make sure not to open more than one order at the same direction.
## what I need is to convert the code itself from an indicator code to EA code ( the use of icustom function is not allowed ) ##
You can contact me if any further information is needed.