Aurix Exchange

Need coding for a trade manager

taju12

Member
Hello !

I need help for a coding of a TRADE MANAGER with the following parameters ;

1 Should be able to work on both 4 and 5 digit brokers.
2 Works with only manually placed trades.
3 Stop loss to be placed 2 pips below or above the most recent swing low or swing high.
(Swing low = A low candle which has at least 2 candles above it on both sides, Swing High = A high

Candle which has at least 2 candles below it on both sides). With a broker that has minimum number of pips for stop loss for example 10 pips and the Swing low or high is less than 10 pips, then it should use the minimum of the broker that is 10 pips .
TAKE PROFITS
1 PARTIAL CLOSE
A , When trades moves 50% of the stop loss in our favor a certain percentage of the traded lot size is taken as will be indicated in the input tab by the trader. Also in the input tab provision should be made for a fixed lot size to be taken because percentage closure does not work on all brokers especially those who don?t allow micro lots.
B , Immediately after the partial close EA moves stop loss to 50%, example If the initial stop loss is -50 pips then it is moved to ? 25.
C , Provision should be made for breakeven + 1 PIPS which will come in effect after the partial close.
D , The remaining lot size will be closed at the fixed take profit originally indicated or its closed manually.
 

stovedude

Active member
Try this one. It was a bear to modify everything, but it can either work on just the same currency that it is attached to, or if you want, it can work for all manual trades on all currencies. You have many different SL,TP,TS, and BE functions to choose from. Default should do what you want though. Test to make sure all options work fine. The only consideration when managing all currencies is that the fractal SL, as well as the PSAR and CandleTrail functions will calculate on the same TF as the chart that the EA is attached to, unless you change the CurrencyTF and CTCurrencyTF to something different than 0 (CTCurrencyTF is just for CandleTrail and PSARTrail). That part gets a little complicated with this setup, but if have ManageAllCurrencies=false, it will not be an issue anyway.
 

Attachments

  • TradeManager2.0.mq4
    20.9 KB · Views: 3

taju12

Member
Try this one. It was a bear to modify everything, but it can either work on just the same currency that it is attached to, or if you want, it can work for all manual trades on all currencies. You have many different SL,TP,TS, and BE functions to choose from. Default should do what you want though. Test to make sure all options work fine. The only consideration when managing all currencies is that the fractal SL, as well as the PSAR and CandleTrail functions will calculate on the same TF as the chart that the EA is attached to, unless you change the CurrencyTF and CTCurrencyTF to something different than 0 (CTCurrencyTF is just for CandleTrail and PSARTrail). That part gets a little complicated with this setup, but if have ManageAllCurrencies=false, it will not be an issue anyway.

HELLO,
I will try and get back to you.
thanks.
 

Aurix Exchange
Top